Fix compilation with GCC 2, which had no __builtin_expect

This commit is contained in:
Dave Hart 2011-05-20 14:18:08 -04:00 committed by Nick Mathewson
parent 5786b91e2e
commit 09d39a120d

View File

@ -179,7 +179,7 @@ long _evutil_weakrand(void);
/* Evaluates to the same boolean value as 'p', and hints to the compiler that /* Evaluates to the same boolean value as 'p', and hints to the compiler that
* we expect this value to be false. */ * 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) #define EVUTIL_UNLIKELY(p) __builtin_expect(!!(p),0)
#else #else
#define EVUTIL_UNLIKELY(p) (p) #define EVUTIL_UNLIKELY(p) (p)