From 20af6f3fe1921987c236a1b6662ee16efaae7be0 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 30 Jan 2011 03:33:05 -0500 Subject: Use the DMNSN_PROFILE macro to turn on profiling per-file. --- configure.ac | 5 ----- libdimension/compiler.h | 6 +++--- 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 -#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) -- cgit v1.2.3