libmoost
/home/mhx/git/github/libmoost/include/moost/compiler/branch_expect.hpp
Go to the documentation of this file.
00001 /* vim:set ts=3 sw=3 sts=3 et: */
00028 #ifndef MOOST_COMPILER_BRANCH_EXPECT_HPP
00029 #define MOOST_COMPILER_BRANCH_EXPECT_HPP
00030 
00043 #if defined(__GNUC__)
00044 
00045 #define expect_likely__(expr)   __builtin_expect((expr),(1==1))
00046 #define expect_unlikely__(expr) __builtin_expect((expr),(1==0))
00047 
00048 #else
00049 
00050 #define expect_likely__(expr)   (expr)
00051 #define expect_unlikely__(expr) (expr)
00052 
00053 #endif
00054 
00055 #endif