Fix warnings on SuSE 9.0.
authorStefan Metzmacher <metze@samba.org>
Sun, 14 Sep 2008 16:50:13 +0000 (18:50 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 14 Sep 2008 16:50:13 +0000 (18:50 +0200)
The macros "[un]likely" are already defined on SuSE 9.0.
Patch from Volker.

(partialy cherry-picked 30d181c92463aecd6e649330d3645d86d5a17e43)
metze

source/lib/talloc/talloc.c

index baf88fe75407095b085ed49a62ac9867f78777c3..1f7e52439f81619ae6f6cb78fdb09f140f878ecd 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