Browse Source

Make sure __hot and __cold are always defined.

Peter Kjellerstedt 15 years ago
parent
commit
2cced20a74
1 changed files with 10 additions and 3 deletions
  1. 10 3
      include/libc-symbols.h

+ 10 - 3
include/libc-symbols.h

@@ -63,12 +63,19 @@
 #ifndef unlikely
 # define unlikely(x)	__builtin_expect((!!(x)),0)
 #endif
-#if defined __GNUC__ && !(__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
 # ifndef __cold
-#   define __cold __attribute__ ((__cold__))
+#  define __cold __attribute__ ((__cold__))
 # endif
 # ifndef __hot
-#   define __hot __attribute__ ((__hot__))
+#  define __hot __attribute__ ((__hot__))
+# endif
+#else
+# ifndef __cold
+#  define __cold
+# endif
+# ifndef __hot
+#  define __hot
 # endif
 #endif
 #ifndef __LINUX_COMPILER_H