Fix warnings on SuSE 9.0.
authorKarolin Seeger <kseeger@samba.org>
Fri, 27 Jun 2008 13:51:35 +0000 (15:51 +0200)
committerKarolin Seeger <kseeger@samba.org>
Fri, 27 Jun 2008 13:51:35 +0000 (15:51 +0200)
The macros "[un]likely" are already defined on SuSE 9.0.
Patch from Volker.
(This used to be commit 30d181c92463aecd6e649330d3645d86d5a17e43)

source3/include/debug.h
source3/lib/talloc/talloc.c

index d8dafcbd457509b25f35ca423d0b4f7b46668028..d1716320b3bb75b28bc2b05d4d6cfd377c11a0f5 100644 (file)
@@ -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) && \
index d535c3d78458296e456524eb2dfacb183195214b..99210f3e1bd6362b61561a776d12118499326632 100644 (file)
 #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