Fix warning about undefined behavior when expanding macro
authorMilian Wolff <mail@milianw.de>
Sun, 29 Jan 2017 19:25:42 +0000 (20:25 +0100)
committerMilian Wolff <mail@milianw.de>
Sun, 29 Jan 2017 19:25:42 +0000 (20:25 +0100)
See e.g. https://reviews.llvm.org/D15866 for more information

src/track/heaptrack_inject.cpp

index 45ffd74..cf3a69f 100644 (file)
 #error unsupported word size
 #endif
 
-#define HAVE_CFREE (defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || defined(__USE_MISC))
+#if defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || defined(__USE_MISC)
+#define HAVE_CFREE 1
+#else
+#define HAVE_CFREE 0
+#endif
 
 namespace {