Explorar o código

fuzz: add support for compiling with c++ compiler

Randy %!s(int64=5) %!d(string=hai) anos
pai
achega
73b0e739d0
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      fuzzing/cjson_read_fuzzer.c

+ 8 - 0
fuzzing/cjson_read_fuzzer.c

@@ -2,6 +2,10 @@
 #include <stdint.h>
 #include <string.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "../cJSON.h"
 
 int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); /* required by C89 */
@@ -66,3 +70,7 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
 
     return 0;
 }
+
+#ifdef __cplusplus
+}
+#endif