[pulseaudio-commits] r2248 - /branches/glitch-free/src/pulsecore/macro.h
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Fri Apr 11 09:35:32 PDT 2008
Author: lennart
Date: Fri Apr 11 18:35:31 2008
New Revision: 2248
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2248&root=pulseaudio&view=rev
Log:
fix linker warning macro code, move pa_strnull() to core-util.h, move PA_LIKELY definitions here from gccmacro.h
Modified:
branches/glitch-free/src/pulsecore/macro.h
Modified: branches/glitch-free/src/pulsecore/macro.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/macro.h?rev=2248&root=pulseaudio&r1=2247&r2=2248&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/macro.h (original)
+++ branches/glitch-free/src/pulsecore/macro.h Fri Apr 11 18:35:31 2008
@@ -33,10 +33,20 @@
#include <stdlib.h>
#include <pulsecore/log.h>
-#include <pulsecore/gccmacro.h>
+#include <pulse/gccmacro.h>
#ifndef PACKAGE
#error "Please include config.h before including this file!"
+#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
#if defined(PAGE_SIZE)
@@ -200,21 +210,17 @@
#define PA_PATH_SEP_CHAR '/'
#endif
-static inline const char *pa_strnull(const char *x) {
- return x ? x : "(null)";
-}
-
-#ifdef __GNUC__
-
-#define PA_WARN_REFERENCE(sym,msg) \
- __asm__(".section .gnu.warning.sym"); \
- __asm__(".asciz \"msg\""); \
+#ifdef __GNUC__
+
+#define PA_WARN_REFERENCE(sym, msg) \
+ __asm__(".section .gnu.warning." #sym); \
+ __asm__(".asciz \"" msg "\""); \
__asm__(".previous")
#else
-#define PA_WARN_REFERENCE(sym,msg)
-
-#endif
-
-#endif
+#define PA_WARN_REFERENCE(sym, msg)
+
+#endif
+
+#endif
More information about the pulseaudio-commits
mailing list