mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 10:56:06 +00:00

Summary: This patch separates platform related macros in lib/fuzzer/FuzzerDefs.h into lib/fuzzer/FuzzerPlatform.h, and use FuzzerPlatform.h where necessary. This separation helps when compiling libFuzzer's interceptor module (under review); an unnecessary include of standard headers (such as string.h) may produce conflicts/ambiguation with the interceptor's declarations/definitions of library functions, which complicates interceptor implementation. Reviewers: morehouse, hctim Reviewed By: morehouse Subscribers: krytarowski, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D83805
22 lines
791 B
C++
22 lines
791 B
C++
//===- FuzzerMain.cpp - main() function and flags -------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
// main() and flags.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "FuzzerDefs.h"
|
|
#include "FuzzerPlatform.h"
|
|
|
|
extern "C" {
|
|
// This function should be defined by the user.
|
|
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
|
|
} // extern "C"
|
|
|
|
ATTRIBUTE_INTERFACE int main(int argc, char **argv) {
|
|
return fuzzer::FuzzerDriver(&argc, &argv, LLVMFuzzerTestOneInput);
|
|
}
|