From 3a1d0978303d9d67416656a333d8fd5d60b1699d Mon Sep 17 00:00:00 2001 From: ckolivas Date: Wed, 7 Mar 2012 17:54:04 +1100 Subject: [PATCH] Bypass most checks performed via the inbuilt expect macros likely and unlikely for non-debug builds. --- configure.ac | 2 +- lrzip_private.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3ef8ccd..5d133c3 100644 --- a/configure.ac +++ b/configure.ac @@ -80,7 +80,7 @@ AC_ARG_ENABLE([static-bin], ) AM_CONDITIONAL([STATIC], [test "x$static" = "xyes"]) -AC_ARG_ENABLE([debug-build], +AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug],[Build debugging code in @<:@default=no@:>@])], [debugbuild=$enableval] ) diff --git a/lrzip_private.h b/lrzip_private.h index 3e51443..8cde7bb 100644 --- a/lrzip_private.h +++ b/lrzip_private.h @@ -117,8 +117,13 @@ extern char *sys_errlist[]; extern int errno; #endif +#ifdef DEBUG_BUILD #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) +#else +#define likely(x) (x)) {}; if (true +#define unlikely(x) (x)) {}; if (false +#endif #define __maybe_unused __attribute__((unused)) typedef long long int i64;