From: Karolin Seeger Date: Fri, 27 Jun 2008 13:51:35 +0000 (+0200) Subject: Fix warnings on SuSE 9.0. X-Git-Tag: samba-3.3.0pre1~726 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=30d181c92463aecd6e649330d3645d86d5a17e43;p=thirdparty%2Fsamba.git Fix warnings on SuSE 9.0. The macros "[un]likely" are already defined on SuSE 9.0. Patch from Volker. --- diff --git a/source/include/debug.h b/source/include/debug.h index d8dafcbd457..d1716320b3b 100644 --- a/source/include/debug.h +++ b/source/include/debug.h @@ -169,12 +169,20 @@ extern bool *DEBUGLEVEL_CLASS_ISSET; #if (__GNUC__ >= 3) /* the strange !! is to ensure that __builtin_expect() takes either 0 or 1 as its first argument */ +#ifndef likely #define likely(x) __builtin_expect(!!(x), 1) +#endif +#ifndef unlikely #define unlikely(x) __builtin_expect(!!(x), 0) +#endif #else +#ifndef likely #define likely(x) (x) +#endif +#ifndef unlikely #define unlikely(x) (x) #endif +#endif #define CHECK_DEBUGLVL( level ) \ ( ((level) <= MAX_DEBUG_LEVEL) && \ diff --git a/source/lib/talloc/talloc.c b/source/lib/talloc/talloc.c index d535c3d7845..99210f3e1bd 100644 --- a/source/lib/talloc/talloc.c +++ b/source/lib/talloc/talloc.c @@ -82,12 +82,20 @@ #if (__GNUC__ >= 3) /* the strange !! is to ensure that __builtin_expect() takes either 0 or 1 as its first argument */ +#ifndef likely #define likely(x) __builtin_expect(!!(x), 1) +#endif +#ifndef unlikely #define unlikely(x) __builtin_expect(!!(x), 0) +#endif #else +#ifndef likely #define likely(x) (x) +#endif +#ifndef unlikely #define unlikely(x) (x) #endif +#endif /* this null_context is only used if talloc_enable_leak_report() or talloc_enable_leak_report_full() is called, otherwise it remains