# HG changeset patch # User reimar # Date 1125737628 0 # Node ID 8b7a72777a12fc8c223c57c2b4d3f2acebfc27f9 # Parent 8e859a01904f3d11c2ed92cffd520b0f68d6a8b6 likely() and unlikely() macros to help (newer) compilers optimize correctly diff -r 8e859a01904f -r 8b7a72777a12 configure --- a/configure Sat Sep 03 08:48:59 2005 +0000 +++ b/configure Sat Sep 03 08:53:48 2005 +0000 @@ -7161,6 +7161,13 @@ /* __builtin_expect branch prediction hint */ $_def_builtin_expect +#ifdef HAVE_BUILTIN_EXPECT +#define likely(x) __builtin_expect ((x) != 0, 1) +#define unlikely(x) __builtin_expect ((x) != 0, 0) +#else +#define likely(x) (x) +#define unlikely(x) (x) +#endif /* attribute(used) as needed by some compilers */ #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)