]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Only use __builtin_expect if __GNUC__ > 3
authorTheodore Ts'o <tytso@mit.edu>
Sun, 13 Jul 2008 12:05:54 +0000 (08:05 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 13 Jul 2008 20:06:56 +0000 (16:06 -0400)
Gcc only supports __builtin_expect for gcc versions 2.96 and up.
Since it's tricky to check for gcc 2.95 vs 2.96 (and either are only
used on really ancient systems anyway), we only use this optimization
on 3.x and newer versions of gcc.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/crc32defs.h

index 7d770d349586fffccfa1c79ee68a192d7a420588..27414d2d05ff69d9d7252b46ba2b201f96e62fd9 100644 (file)
@@ -55,7 +55,7 @@
 #define __le32_to_cpu(x) (x)
 #endif
 
-#ifdef __GNUC__
+#if (__GNUC__ >= 3)
 #define likely(x)      __builtin_expect(!!(x), 1)
 #define unlikely(x)    __builtin_expect(!!(x), 0)
 #else