summaryrefslogtreecommitdiff
path: root/tests/allocator.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-11-10 21:35:59 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-11-10 21:35:59 -0800
commit492ebc22bc2a7bf6710d5e154dd6f37c120de4fd (patch)
tree0d7ab7df789dbd0581ffc464857f8c249732132f /tests/allocator.cpp
parentba9504325ed152ddc5b3fdc94e77df217e83f364 (diff)
tests: Fix expansion-to-defined warning
This warning is new as of GCC 7 and highlights undefined behavior in the preprocessor that ASAN detection was relying on.
Diffstat (limited to 'tests/allocator.cpp')
-rw-r--r--tests/allocator.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/allocator.cpp b/tests/allocator.cpp
index c3ade48..588e456 100644
--- a/tests/allocator.cpp
+++ b/tests/allocator.cpp
@@ -8,7 +8,11 @@
#if defined(__has_feature)
# define ADDRESS_SANITIZER __has_feature(address_sanitizer)
#else
-# define ADDRESS_SANITIZER defined(__SANITIZE_ADDRESS__)
+# if defined(__SANITIZE_ADDRESS__)
+# define ADDRESS_SANITIZER 1
+# else
+# define ADDRESS_SANITIZER 0
+# endif
#endif
// Low-level allocation functions