[FFmpeg-cvslog] all: add _DEFAULT_SOURCE locally wherever needed

Ganesh Ajjanagadde git at videolan.org
Sun Oct 4 18:46:11 CEST 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Sat Oct  3 07:41:00 2015 -0500| [26e8895b7395ed180dcb7e30465058c45050b5e2] | committer: Ronald S. Bultje

all: add _DEFAULT_SOURCE locally wherever needed

Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE and _SVID_SOURCE.
The solution from man feature_test_macros is to define both _DEFAULT_SOURCE and the old macros.
This solution is on the lines of the one in commit af1818276ef271af98e2e2bbabb4dc875b4fa7d8.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>

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

 libavformat/img2dec.c |    1 +
 libavformat/udp.c     |    1 +
 libswscale/utils.c    |    1 +
 3 files changed, 3 insertions(+)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 1697579..0cbcf4a 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define _DEFAULT_SOURCE
 #define _BSD_SOURCE
 #include <sys/stat.h>
 #include "libavutil/avstring.h"
diff --git a/libavformat/udp.c b/libavformat/udp.c
index d40ea97..1bda5af 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -24,6 +24,7 @@
  * UDP protocol
  */
 
+#define _DEFAULT_SOURCE
 #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 eb1c940..651b07a 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -20,6 +20,7 @@
 
 #include "config.h"
 
+#define _DEFAULT_SOURCE
 #define _SVID_SOURCE // needed for MAP_ANONYMOUS
 #define _DARWIN_C_SOURCE // needed for MAP_ANON
 #include <inttypes.h>



More information about the ffmpeg-cvslog mailing list