]> granicus.if.org Git - libevent/commitdiff
Fix compilation with GCC 2, which had no __builtin_expect
authorDave Hart <hart@ntp.org>
Fri, 20 May 2011 18:18:08 +0000 (14:18 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 20 May 2011 18:18:08 +0000 (14:18 -0400)
util-internal.h

index 18d6ca75cae3f6a7a9cade32ea240df1b7ac4251..fe9ff3568efbc2631464ced206deff900f8095be 100644 (file)
@@ -179,7 +179,7 @@ long _evutil_weakrand(void);
 
 /* Evaluates to the same boolean value as 'p', and hints to the compiler that
  * we expect this value to be false. */
-#ifdef __GNUC__
+#if defined(__GNUC__) && __GNUC__ >= 3         /* gcc 3.0 or later */
 #define EVUTIL_UNLIKELY(p) __builtin_expect(!!(p),0)
 #else
 #define EVUTIL_UNLIKELY(p) (p)