Commit d5c4abb3 authored by Aaryaman Sagar's avatar Aaryaman Sagar Committed by Facebook Github Bot

Define sanitize macros if they weren't already defined

Summary: As title

Reviewed By: yfeldblum

Differential Revision: D16821444

fbshipit-source-id: 14f0655caf0f53ef47fa65b9b6ba57f0f190df12
parent e7a9b358
...@@ -71,9 +71,11 @@ ...@@ -71,9 +71,11 @@
* Use FOLLY_LIBRARY_SANITIZE_ADDRESS (defined in folly-config.h) to check if * Use FOLLY_LIBRARY_SANITIZE_ADDRESS (defined in folly-config.h) to check if
* folly itself was compiled with ASAN enabled. * folly itself was compiled with ASAN enabled.
*/ */
#ifndef FOLLY_SANITIZE_ADDRESS
#if FOLLY_HAS_FEATURE(address_sanitizer) || __SANITIZE_ADDRESS__ #if FOLLY_HAS_FEATURE(address_sanitizer) || __SANITIZE_ADDRESS__
#define FOLLY_SANITIZE_ADDRESS 1 #define FOLLY_SANITIZE_ADDRESS 1
#endif #endif
#endif
/* Define attribute wrapper for function attribute used to disable /* Define attribute wrapper for function attribute used to disable
* address sanitizer instrumentation. Unfortunately, this attribute * address sanitizer instrumentation. Unfortunately, this attribute
...@@ -101,9 +103,11 @@ ...@@ -101,9 +103,11 @@
/* Define a convenience macro to test when thread sanitizer is being used /* Define a convenience macro to test when thread sanitizer is being used
* across the different compilers (e.g. clang, gcc) */ * across the different compilers (e.g. clang, gcc) */
#ifndef FOLLY_SANITIZE_THREAD
#if FOLLY_HAS_FEATURE(thread_sanitizer) || __SANITIZE_THREAD__ #if FOLLY_HAS_FEATURE(thread_sanitizer) || __SANITIZE_THREAD__
#define FOLLY_SANITIZE_THREAD 1 #define FOLLY_SANITIZE_THREAD 1
#endif #endif
#endif
#if FOLLY_SANITIZE_THREAD #if FOLLY_SANITIZE_THREAD
#define FOLLY_DISABLE_THREAD_SANITIZER \ #define FOLLY_DISABLE_THREAD_SANITIZER \
...@@ -116,9 +120,11 @@ ...@@ -116,9 +120,11 @@
* Define a convenience macro to test when ASAN, UBSAN or TSAN sanitizer are * Define a convenience macro to test when ASAN, UBSAN or TSAN sanitizer are
* being used * being used
*/ */
#ifndef FOLLY_SANITIZE
#if defined(FOLLY_SANITIZE_ADDRESS) || defined(FOLLY_SANITIZE_THREAD) #if defined(FOLLY_SANITIZE_ADDRESS) || defined(FOLLY_SANITIZE_THREAD)
#define FOLLY_SANITIZE 1 #define FOLLY_SANITIZE 1
#endif #endif
#endif
#if FOLLY_SANITIZE #if FOLLY_SANITIZE
#define FOLLY_DISABLE_UNDEFINED_BEHAVIOR_SANITIZER(...) \ #define FOLLY_DISABLE_UNDEFINED_BEHAVIOR_SANITIZER(...) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment