From: Zachary Turner Date: Wed, 30 Nov 2016 16:32:54 +0000 (+0000) Subject: [LibFuzzer] Add macro flags for Posix and Windows. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ed9686965ed26af19868e37fb7093989687e296;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288249 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Fuzzer/FuzzerDefs.h b/lib/Fuzzer/FuzzerDefs.h index 287e23c7afd..13aa212c96c 100644 --- a/lib/Fuzzer/FuzzerDefs.h +++ b/lib/Fuzzer/FuzzerDefs.h @@ -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