[PATCH] D20409: [LibFuzzer] Fix NumberOfCpuCores() for Mac OSX

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 22:20:21 PDT 2016


kcc added a comment.

Grrr, those pesky #ifdefs. This code could be as easily written in C++ instead of the C preprocessor. (well, almost)

#define in one place in FuzzerInternal.h things like LIBFUZZER_LINUX and LIBFUZZER_MAC (0 or 1). 
Then do 
if(LIBFUZZER_LINUX) .. else if (LIBFUZZER_MAC) ... else { assert(0 && "text")}


http://reviews.llvm.org/D20409





More information about the llvm-commits mailing list