[klibc] [patch] compiler.h fix use of likely/unlikely

maximilian attems maks at sternwelten.at
Tue Jun 20 04:49:20 PDT 2006


patch from Hannes Reinecke <hare at suse.de> reduces noise 
on s390 build logs.
while we are it remove check for early 2.X gcc versions.

Signed-off-by: maximilian attems <maks at sternwelten.at>

diff --git a/usr/include/klibc/compiler.h b/usr/include/klibc/compiler.h
index 893f8a9..b7d9b50 100644
--- a/usr/include/klibc/compiler.h
+++ b/usr/include/klibc/compiler.h
@@ -91,12 +91,12 @@ # define __mallocfunc
 #endif
 
 /* likely/unlikely */
-#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
-# define __likely(x)   __builtin_expect((x), 1)
-# define __unlikely(x) __builtin_expect((x), 0)
+#if defined(__GNUC__)
+# define likely(x)   __builtin_expect((x), 1)
+# define unlikely(x) __builtin_expect((x), 0)
 #else
-# define __likely(x)   (x)
-# define __unlikely(x) (x)
+# define likely(x)   (x)
+# define unlikely(x) (x)
 #endif
 
 /* Possibly unused function */



More information about the klibc mailing list