Bypass most checks performed via the inbuilt expect macros likely and unlikely for non-debug builds.

This commit is contained in:
ckolivas 2012-03-07 17:54:04 +11:00
parent fcb1a35688
commit 3a1d097830
2 changed files with 6 additions and 1 deletions

View file

@ -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]
)

View file

@ -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;