likely() and unlikely() macros to help (newer) compilers optimize correctly

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16369 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar committed 2005-09-03 08:53:48 +00:00
1 parent df50ce22f3
commit dbe33c933e
1 file changed
+7
Vendored
+7
View File
@@ -7161,6 +7161,13 @@ $_def_restrict_keyword
/* __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)