summaryrefslogtreecommitdiff
path: root/include/features.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-03-12 08:24:24 +0000
committerEric Andersen <andersen@codepoet.org>2002-03-12 08:24:24 +0000
commit0eccd99fb0ef62001bde22625dc74935f4bfc654 (patch)
treea774bdaa493e7e03cb60d8e82e972f679aa8d652 /include/features.h
parent16952cf2cc8f5ec0ef6bff66909ff211e2eddbe8 (diff)
Fix a segfault in scandir for empty directories. After looking over
our version, I'm adopting the scandir from glibc (with minor changes) instead as it seems simpler and already correct.
Diffstat (limited to 'include/features.h')
-rw-r--r--include/features.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/features.h b/include/features.h
index 8b69a5828..7af149bcc 100644
--- a/include/features.h
+++ b/include/features.h
@@ -411,9 +411,12 @@ uClibc was built without large file support enabled.
#endif
/* Prepare for the case that `__builtin_expect' is not available. */
-#ifndef HAVE_BUILTIN_EXPECT
-# define __builtin_expect(expr, val) (expr)
+#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
+#define __builtin_expect(x, expected_value) (x)
#endif
+#define likely(x) __builtin_expect((x),1)
+#define unlikely(x) __builtin_expect((x),0)
+
#endif /* features.h */