Dan Liew | d3c3311 | 2016-06-02 05:48:02 +0000 | [diff] [blame^] | 1 | //===- FuzzerExtFunctions.h - Interface to external functions ---*- C++ -* ===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // Defines an interface to (possibly optional) functions. |
| 10 | //===----------------------------------------------------------------------===// |
| 11 | #ifndef LLVM_FUZZER_EXT_FUNCTIONS_H |
| 12 | #define LLVM_FUZZER_EXT_FUNCTIONS_H |
| 13 | |
| 14 | #include <stddef.h> |
| 15 | #include <stdint.h> |
| 16 | |
| 17 | namespace fuzzer { |
| 18 | |
| 19 | struct ExternalFunctions { |
| 20 | // Initialize function pointers. Functions that are not available |
| 21 | // will be set to nullptr. |
| 22 | ExternalFunctions(); |
| 23 | |
| 24 | #define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ |
| 25 | RETURN_TYPE(*NAME) FUNC_SIG = nullptr |
| 26 | |
| 27 | #include "FuzzerExtFunctions.def" |
| 28 | |
| 29 | #undef EXT_FUNC |
| 30 | }; |
| 31 | } // namespace fuzzer |
| 32 | #endif |