[llvm] r288249 - [LibFuzzer] Add macro flags for Posix and Windows.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 08:32:54 PST 2016


Author: zturner
Date: Wed Nov 30 10:32:54 2016
New Revision: 288249

URL: http://llvm.org/viewvc/llvm-project?rev=288249&view=rev
Log:
[LibFuzzer] Add macro flags for Posix and Windows.

This is the beginning of an effort to get libfuzzer working on
Windows.  This is a NFC to just add some macros for platform
detection on Windows.

Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27229

Modified:
    llvm/trunk/lib/Fuzzer/FuzzerDefs.h

Modified: llvm/trunk/lib/Fuzzer/FuzzerDefs.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerDefs.h?rev=288249&r1=288248&r2=288249&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerDefs.h (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerDefs.h Wed Nov 30 10:32:54 2016
@@ -20,15 +20,23 @@
 
 // Platform detection.
 #ifdef __linux__
-#define LIBFUZZER_LINUX 1
 #define LIBFUZZER_APPLE 0
+#define LIBFUZZER_LINUX 1
+#define LIBFUZZER_WINDOWS 0
 #elif __APPLE__
-#define LIBFUZZER_LINUX 0
 #define LIBFUZZER_APPLE 1
+#define LIBFUZZER_LINUX 0
+#define LIBFUZZER_WINDOWS 0
+#elif _WIN32
+#define LIBFUZZER_APPLE 0
+#define LIBFUZZER_LINUX 0
+#define LIBFUZZER_WINDOWS 1
 #else
 #error "Support for your platform has not been implemented"
 #endif
 
+#define LIBFUZZER_POSIX LIBFUZZER_APPLE || LIBFUZZER_LINUX
+
 #ifdef __x86_64
 #define ATTRIBUTE_TARGET_POPCNT __attribute__((target("popcnt")))
 #else




More information about the llvm-commits mailing list