Silence warnings such as:

 libavformat/udp.c:27:9: warning: '_DEFAULT_SOURCE'
       macro redefined [-Wmacro-redefined]
 #define _DEFAULT_SOURCE
         ^
 <command line>:4:9: note: previous definition is here
 #define _DEFAULT_SOURCE 1
         ^
---
I'm not sure this is the right approach, since configure explicitly adds
        add_${pfx}cppflags -D_DEFAULT_SOURCE
in my compiler flag...
Any better ideas?
Vittorio

 libavformat/os_support.c | 2 ++
 libavformat/udp.c        | 2 ++
 libswscale/utils.c       | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index c125dbe9ba..79be31dd82 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -21,7 +21,9 @@
  */
 
 /* needed by inet_aton() */
+#ifndef _DEFAULT_SOURCE
 #define _DEFAULT_SOURCE
+#endif
 #define _SVID_SOURCE
 
 #include "config.h"
diff --git a/libavformat/udp.c b/libavformat/udp.c
index a29eb1bd33..0994f4f198 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -24,7 +24,9 @@
  * UDP protocol
  */
 
+#ifndef _DEFAULT_SOURCE
 #define _DEFAULT_SOURCE
+#endif
 #define _BSD_SOURCE     /* Needed for using struct ip_mreq with recent glibc */
 
 #include "avformat.h"
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 786774f241..07c336eef5 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -20,7 +20,9 @@
 
 #include "config.h"
 
+#ifndef _DEFAULT_SOURCE
 #define _DEFAULT_SOURCE
+#endif
 #define _SVID_SOURCE // needed for MAP_ANONYMOUS
 #include <assert.h>
 #include <inttypes.h>
-- 
2.14.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to