diff --git a/tests/allocator.cpp b/tests/allocator.cpp
index c3ade48a9805853c6433f30b2738a01cab3c5efe..588e456179920ce0a373a95bba35713f176965c0 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