folly: #define UNDEFINED_SANITIZER in ubsan mode
authorLucian Grijincu <lucian@fb.com>
Tue, 2 Feb 2016 01:00:24 +0000 (17:00 -0800)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Tue, 2 Feb 2016 01:20:26 +0000 (17:20 -0800)
commit8b7f6f5a5b17117e9da8c1497937da80ea72e5b9
tree0f93da1ce2ce0b75d4ad4102f76cc5be9bb8d352
parent20bd643d25350e6cf0bb0232a5ebf78522b359e9
folly: #define UNDEFINED_SANITIZER in ubsan mode

Summary:
Undefined Sanitizer doesn't define any macro to detect that it's active.

The build system should provide `-DUNDEFINED_SANITIZER` when building
with -fsanitize=undefined or any of the other flags from
http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

FWIW: Chrome defines the same preprocessor symbol:
https://chromium.googlesource.com/chromium/src/+/ac18f489dca8c902e4dfaa1a28d716b7914121d0%5E%21/build/common.gypi

Reviewed By: andrewjcg

Differential Revision: D2885167

fb-gh-sync-id: e1129c0863bfde5d032c32e7d5cea7c43d82009f
folly/CPortability.h
folly/test/MemcpyTest.cpp