[FFmpeg-cvslog] lavc/pthread: do not re-define _GNU_SOURCE if already defined.

Clément Bœsch git at videolan.org
Mon Dec 24 00:54:29 CET 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Dec 23 22:50:44 2012 +0100| [98dc25672fb7116d5885a4133f07b66cec99f187] | committer: Clément Bœsch

lavc/pthread: do not re-define _GNU_SOURCE if already defined.

This fixes the following warning with GCC:
    libavcodec/pthread.c:35:0: warning: _GNU_SOURCE redefined [enabled by default]
    <command-line>::0: note: this is the location of the previous definition

The reason of the presence of this flag is:
    % pkg-config --cflags sdl
    -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98dc25672fb7116d5885a4133f07b66cec99f187
---

 libavcodec/pthread.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index ed6f0e1..b55cccf 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -32,7 +32,9 @@
 #include "config.h"
 
 #if HAVE_SCHED_GETAFFINITY
-#define _GNU_SOURCE
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
 #include <sched.h>
 #endif
 #if HAVE_GETPROCESSAFFINITYMASK



More information about the ffmpeg-cvslog mailing list