summaryrefslogtreecommitdiffstats
path: root/talloc/talloc.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-09-25 01:51:49 -0400
committerSimo Sorce <idra@samba.org>2008-09-25 02:30:18 -0400
commitf698831f0ae0cd86225eb647ae4aeb813f08d3b5 (patch)
tree55689de966245292e6ae517480c668ce993caf70 /talloc/talloc.c
parentcced59be44cbc2204314bdf77a35b41b81bf4097 (diff)
downloadsssd-f698831f0ae0cd86225eb647ae4aeb813f08d3b5.tar.gz
sssd-f698831f0ae0cd86225eb647ae4aeb813f08d3b5.tar.xz
sssd-f698831f0ae0cd86225eb647ae4aeb813f08d3b5.zip
Sync with upstream changes
Diffstat (limited to 'talloc/talloc.c')
-rw-r--r--talloc/talloc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/talloc/talloc.c b/talloc/talloc.c
index 12b85f5a6..1f7e52439 100644
--- a/talloc/talloc.c
+++ b/talloc/talloc.c
@@ -82,11 +82,19 @@
#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
-#define likely(x) x
-#define unlikely(x) x
+#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