summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac5
-rw-r--r--libdimension/compiler.h6
2 files changed, 3 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 8b6e363..3973a6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,11 +61,6 @@ AC_ARG_ENABLE([profile],
[],
[enable_profile=no])
AM_CONDITIONAL([PROFILE], [test "$enable_profile" = "yes"])
-if test "$enable_profile" = "yes"; then
- AC_DEFINE([DMNSN_PROFILE], [1])
-else
- AC_DEFINE([DMNSN_PROFILE], [0])
-fi
dnl Timing library for benchmarks
PKG_CHECK_MODULES([libsandglass], [libsandglass >= 0.2],
diff --git a/libdimension/compiler.h b/libdimension/compiler.h
index b1cf60c..d05d775 100644
--- a/libdimension/compiler.h
+++ b/libdimension/compiler.h
@@ -28,11 +28,11 @@
#include <stdbool.h>
-#if DMNSN_PROFILE
+#ifdef DMNSN_PROFILE
#define dmnsn_likely(test) \
- dmnsn_expect((test), true, DMNSN_FUNC, __FILE__, __LINE__)
+ dmnsn_expect(!!(test), true, DMNSN_FUNC, __FILE__, __LINE__)
#define dmnsn_unlikely(test) \
- dmnsn_expect((test), false, DMNSN_FUNC, __FILE__, __LINE__)
+ dmnsn_expect(!!(test), false, DMNSN_FUNC, __FILE__, __LINE__)
#elif defined(__GNUC__)
#define dmnsn_likely(test) __builtin_expect(!!(test), true)
#define dmnsn_unlikely(test) __builtin_expect(!!(test), false)