about summary refs log tree commit diff
path: root/custom_mutators/libfuzzer/FuzzerExtFunctionsWindows.cpp
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-09-21 15:47:10 +0200
committervan Hauser <vh@thc.org>2020-09-21 15:47:10 +0200
commit207cbd5cf7c1956969f42e89bfcb9a0ab451e351 (patch)
treea66af166a8c5ea07adc570b28d68ed53433876dc /custom_mutators/libfuzzer/FuzzerExtFunctionsWindows.cpp
parentf34fe1f81e804bccdda5315968f6a73a47184822 (diff)
downloadafl++-207cbd5cf7c1956969f42e89bfcb9a0ab451e351.tar.gz
fix and update libfuzzer custom mutator
Diffstat (limited to 'custom_mutators/libfuzzer/FuzzerExtFunctionsWindows.cpp')
-rw-r--r--custom_mutators/libfuzzer/FuzzerExtFunctionsWindows.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/custom_mutators/libfuzzer/FuzzerExtFunctionsWindows.cpp b/custom_mutators/libfuzzer/FuzzerExtFunctionsWindows.cpp
index 630f352d..a727220a 100644
--- a/custom_mutators/libfuzzer/FuzzerExtFunctionsWindows.cpp
+++ b/custom_mutators/libfuzzer/FuzzerExtFunctionsWindows.cpp
@@ -45,16 +45,15 @@ using namespace fuzzer;
   #endif  // LIBFUZZER_MSVC
 
 extern "C" {
-
-  #define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN)
-RETURN_TYPE NAME##Def FUNC_SIG {
-
-  Printf("ERROR: Function \"%s\" not defined.\n", #NAME);
-  exit(1);
-
-}
-
-EXTERNAL_FUNC(NAME, NAME##Def) RETURN_TYPE NAME FUNC_SIG
+\
+  #define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN)         \
+    RETURN_TYPE NAME##Def FUNC_SIG {                          \
+                                                              \
+      Printf("ERROR: Function \"%s\" not defined.\n", #NAME); \
+      exit(1);                                                \
+                                                              \
+    }                                                         \
+    EXTERNAL_FUNC(NAME, NAME##Def) RETURN_TYPE NAME FUNC_SIG
 
   #include "FuzzerExtFunctions.def"
 
@@ -81,8 +80,8 @@ namespace fuzzer {
 
 ExternalFunctions::ExternalFunctions() {
 \
-  #define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) this->NAME =
-      GetFnPtr < decltype(::NAME)>(::NAME, ::NAME##Def, #NAME, WARN);
+  #define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
+    this->NAME = GetFnPtr<decltype(::NAME)>(::NAME, ::NAME##Def, #NAME, WARN);
 
   #include "FuzzerExtFunctions.def"