diff options
author | Jonathan Metzman <metzman@chromium.org> | 2019-01-17 16:36:05 +0000 |
---|---|---|
committer | Jonathan Metzman <metzman@chromium.org> | 2019-01-17 16:36:05 +0000 |
commit | b795c31dffc5b689ac15640c8a7f67d7a293bc95 (patch) | |
tree | 6dc077a743d6d25cc5042e1d6e061b3a8881a068 /compiler-rt/lib/fuzzer/FuzzerDriver.cpp | |
parent | 8d86f1ba475c2e2adafd7d2e93ac26502de788ce (diff) | |
download | bcm5719-llvm-b795c31dffc5b689ac15640c8a7f67d7a293bc95.tar.gz bcm5719-llvm-b795c31dffc5b689ac15640c8a7f67d7a293bc95.zip |
[libFuzzer][MSVC] Make attribute-use compatible with MSVC
Summary:
Replace attributes with macros that use equivalent declspecs
for MSVC.
Reviewers: vitalybuka
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D56512
llvm-svn: 351456
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerDriver.cpp')
-rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerDriver.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp index ff2a639ac4a..92d4489c6cd 100644 --- a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp @@ -29,7 +29,12 @@ // This function should be present in the libFuzzer so that the client // binary can test for its existence. +#if LIBFUZZER_MSVC +extern "C" void __libfuzzer_is_present() {} +#pragma comment(linker, "/include:__libfuzzer_is_present") +#else extern "C" __attribute__((used)) void __libfuzzer_is_present() {} +#endif // LIBFUZZER_MSVC namespace fuzzer { |