[pulseaudio-commits] r2032 - /trunk/src/pulsecore/gccmacro.h
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Thu Nov 8 17:28:57 PST 2007
Author: lennart
Date: Fri Nov 9 02:28:56 2007
New Revision: 2032
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2032&root=pulseaudio&view=rev
Log:
add support for likely()/unlikely() type macros
Modified:
trunk/src/pulsecore/gccmacro.h
Modified: trunk/src/pulsecore/gccmacro.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/gccmacro.h?rev=2032&root=pulseaudio&r1=2031&r2=2032&view=diff
==============================================================================
--- trunk/src/pulsecore/gccmacro.h (original)
+++ trunk/src/pulsecore/gccmacro.h Fri Nov 9 02:28:56 2007
@@ -60,7 +60,7 @@
#endif
#ifndef PA_GCC_PURE
-#ifdef __GNUCC__
+#ifdef __GNUC__
#define PA_GCC_PURE __attribute__ ((pure))
#else
/** This function's return value depends only the arguments list and global state **/
@@ -69,7 +69,7 @@
#endif
#ifndef PA_GCC_CONST
-#ifdef __GNUCC__
+#ifdef __GNUC__
#define PA_GCC_CONST __attribute__ ((const))
#else
/** This function's return value depends only the arguments list (stricter version of PA_GCC_PURE) **/
@@ -77,4 +77,14 @@
#endif
#endif
+#ifndef PA_LIKELY
+#ifdef __GNUC__
+#define PA_LIKELY(x) __builtin_expect((x),1)
+#define PA_UNLIKELY(x) __builtin_expect((x),0)
+#else
+#define PA_LIKELY(x) (x)
+#define PA_UNLIKELY(x) (x)
#endif
+#endif
+
+#endif
More information about the pulseaudio-commits
mailing list