12 #ifndef LLVM_FUZZER_DEFS_H
13 #define LLVM_FUZZER_DEFS_H
24 #define LIBFUZZER_APPLE 0
25 #define LIBFUZZER_LINUX 1
26 #define LIBFUZZER_WINDOWS 0
28 #define LIBFUZZER_APPLE 1
29 #define LIBFUZZER_LINUX 0
30 #define LIBFUZZER_WINDOWS 0
32 #define LIBFUZZER_APPLE 0
33 #define LIBFUZZER_LINUX 0
34 #define LIBFUZZER_WINDOWS 1
36 #error "Support for your platform has not been implemented"
39 #define LIBFUZZER_POSIX LIBFUZZER_APPLE || LIBFUZZER_LINUX
42 #define ATTRIBUTE_TARGET_POPCNT __attribute__((target("popcnt")))
44 #define ATTRIBUTE_TARGET_POPCNT
48 #ifdef __clang__ // avoid gcc warning.
49 # define ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory")))
51 # define ATTRIBUTE_NO_SANITIZE_MEMORY
56 template <
class T>
T Min(
T a,
T b) {
return a < b ? a : b; }
57 template <
class T>
T Max(
T a,
T b) {
return a > b ? a : b; }
61 class DictionaryEntry;
62 class MutationDispatcher;
63 struct FuzzingOptions;
66 struct ExternalFunctions;
69 extern ExternalFunctions *
EF;
71 typedef std::vector<uint8_t>
Unit;
82 inline uint8_t
Bswap(uint8_t x) {
return x; }
83 inline uint16_t
Bswap(uint16_t x) {
return __builtin_bswap16(x); }
85 inline uint64_t
Bswap(uint64_t x) {
return __builtin_bswap64(x); }
89 #endif // LLVM_FUZZER_DEFS_H
int(* UserCallback)(const uint8_t *Data, size_t Size)
int FuzzerDriver(int *argc, char ***argv, UserCallback Callback)
~ScopedDoingMyOwnMemmem()
std::vector< Unit > UnitVector
std::vector< uint8_t > Unit