Răsfoiți Sursa

Merge pull request #9 from kevcadieux/msvc-asan-support

Adding AddressSanitizer detection for MSVC and GCC
liam-mitchell 4 ani în urmă
părinte
comite
fbcc34e89c
1 a modificat fișierele cu 5 adăugiri și 3 ștergeri
  1. 5 3
      include/EAStdC/internal/Config.h

+ 5 - 3
include/EAStdC/internal/Config.h

@@ -274,10 +274,12 @@
 // EASTDC_ASAN_ENABLED
 //
 // Defined as 0 or 1. It's value depends on the compile environment.
-// Specifies whether the code is being built with Clang's Address Sanitizer.
+// Specifies whether the code is being built with Address Sanitizer.
 //
-#if defined(__has_feature)
-	#if __has_feature(address_sanitizer)
+#if defined(__SANITIZE_ADDRESS__) // GCC or MSVC
+	#define EASTDC_ASAN_ENABLED 1
+#elif defined(__has_feature)
+	#if __has_feature(address_sanitizer)  // Clang
 		#define EASTDC_ASAN_ENABLED 1
 	#else
 		#define EASTDC_ASAN_ENABLED 0