From 0eccd99fb0ef62001bde22625dc74935f4bfc654 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 12 Mar 2002 08:24:24 +0000 Subject: 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. --- include/features.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/features.h') 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 */ -- cgit v1.2.3