[MPlayer-dev-eng] [PATCH] Fix build after changes to libavutil.

Nicolas George nicolas.george at normalesup.org
Thu Jun 21 22:20:07 CEST 2012


mathematics.h no longer defines the various M_ constants.
Building ffmpeg thus requires _XOPEN_SOURCE=600.
Which in turns requires other changes:
- strcasecmp requires strings.h;
- the second argument of gettimeofday must be NULL;
- some network functions and structures require _BSD_SOURCE.
---
 asxparser.c                |    1 +
 codec-cfg.c                |    1 +
 command.c                  |    1 +
 configure                  |    4 +++-
 input/input.c              |    1 +
 libaf/format.c             |    1 +
 libao2/ao_oss.c            |    1 +
 libmpcodecs/ad_libvorbis.c |    1 +
 libmpcodecs/vd_ffmpeg.c    |    1 +
 libmpcodecs/ve_lavc.c      |    1 +
 libmpcodecs/ve_x264.c      |    1 +
 libmpcodecs/ve_xvid4.c     |    1 +
 libmpcodecs/vf_palette.c   |    1 +
 libmpdemux/demux_mf.c      |    1 +
 libmpdemux/demux_ogg.c     |    1 +
 libmpdemux/demux_viv.c     |    1 +
 libmpdemux/demuxer.c       |    1 +
 libmpdemux/extension.c     |    1 +
 libmpdemux/muxer_mpeg.c    |    1 +
 libvo/vo_aa.c              |    1 +
 libvo/vo_matrixview.c      |    1 +
 libvo/vo_vdpau.c           |    1 +
 libvo/vosub_vidix.c        |    1 +
 libvo/x11_common.c         |    1 +
 m_config.c                 |    1 +
 m_option.c                 |    1 +
 m_struct.c                 |    1 +
 mencoder.c                 |    1 +
 mp_msg.c                   |    1 +
 mplayer.c                  |    1 +
 parser-mpcmd.c             |    1 +
 playtree.c                 |    1 +
 playtreeparser.c           |    1 +
 stream/asf_streaming.c     |    1 +
 stream/http.c              |    1 +
 stream/librtsp/rtsp.c      |    1 +
 stream/librtsp/rtsp_rtp.c  |    1 +
 stream/network.c           |    1 +
 stream/stream_bd.c         |    1 +
 stream/stream_dvd.c        |    1 +
 stream/stream_pvr.c        |    1 +
 stream/tv.c                |    1 +
 stream/tvi_v4l2.c          |    1 +
 stream/udp.c               |    1 +
 sub/font_load_ft.c         |    1 +
 sub/spudec.c               |    1 +
 sub/subassconvert.c        |    1 +
 sub/subreader.c            |    1 +
 sub/vobsub.c               |    1 +
 subopt-helper.c            |    1 +
 udp_sync.c                 |    2 ++
 51 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/asxparser.c b/asxparser.c
index 9cdd306..e63b825 100644
--- a/asxparser.c
+++ b/asxparser.c
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 
 #include "playtree.h"
diff --git a/codec-cfg.c b/codec-cfg.c
index 3913ea1..fc1bed2 100644
--- a/codec-cfg.c
+++ b/codec-cfg.c
@@ -40,6 +40,7 @@
 #include <ctype.h>
 #include <assert.h>
 #include <string.h>
+#include <strings.h>
 
 #include "config.h"
 #include "mp_msg.h"
diff --git a/command.c b/command.c
index 484fd75..28121b2 100644
--- a/command.c
+++ b/command.c
@@ -20,6 +20,7 @@
 #include <inttypes.h>
 #include <unistd.h>
 #include <string.h>
+#include <strings.h>
 
 #include "config.h"
 #include "command.h"
diff --git a/configure b/configure
index 1079193..0be7d53 100755
--- a/configure
+++ b/configure
@@ -2627,6 +2627,8 @@ else
   CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
 fi
 
+CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112"
+
 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
 
@@ -3937,7 +3939,7 @@ echores "$_select"
 echocheck "gettimeofday()"
 gettimeofday=yes
 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
-statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' ||
+statement_check sys/time.h 'struct timeval tv; gettimeofday(&tv, 0)' ||
     { gettimeofday=no ; def_gettimeofday='#undef HAVE_GETTIMEOFDAY' ; }
 echores "$gettimeofday"
 
diff --git a/input/input.c b/input/input.c
index d8f094e..13b98f0 100644
--- a/input/input.c
+++ b/input/input.c
@@ -20,6 +20,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
diff --git a/libaf/format.c b/libaf/format.c
index 5b7be18..a05f540 100644
--- a/libaf/format.c
+++ b/libaf/format.c
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <inttypes.h>
 #include <limits.h>
 
diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c
index 6373f44..8963b8b 100644
--- a/libao2/ao_oss.c
+++ b/libao2/ao_oss.c
@@ -29,6 +29,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
+#include <strings.h>
 
 #include "config.h"
 #include "mp_msg.h"
diff --git a/libmpcodecs/ad_libvorbis.c b/libmpcodecs/ad_libvorbis.c
index 8975fe6..a4bdd25 100644
--- a/libmpcodecs/ad_libvorbis.c
+++ b/libmpcodecs/ad_libvorbis.c
@@ -18,6 +18,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <strings.h>
 #include <unistd.h>
 #include <stdarg.h>
 #include <math.h>
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 4266db4..76c12a0 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -18,6 +18,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <strings.h>
 #include <assert.h>
 #include <time.h>
 
diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c
index 1cd9cbf..8fdfcd2 100644
--- a/libmpcodecs/ve_lavc.c
+++ b/libmpcodecs/ve_lavc.c
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <math.h>
 #include <limits.h>
 #include <time.h>
diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c
index 976123a..b973c44 100644
--- a/libmpcodecs/ve_x264.c
+++ b/libmpcodecs/ve_x264.c
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 
 #include "config.h"
diff --git a/libmpcodecs/ve_xvid4.c b/libmpcodecs/ve_xvid4.c
index 1099ad3..eeffdc5 100644
--- a/libmpcodecs/ve_xvid4.c
+++ b/libmpcodecs/ve_xvid4.c
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 #include <math.h>
 #include <limits.h>
diff --git a/libmpcodecs/vf_palette.c b/libmpcodecs/vf_palette.c
index 45fc41b..5a5ccb9 100644
--- a/libmpcodecs/vf_palette.c
+++ b/libmpcodecs/vf_palette.c
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <inttypes.h>
 
 #include "config.h"
diff --git a/libmpdemux/demux_mf.c b/libmpdemux/demux_mf.c
index f8670a1..52ba6df 100644
--- a/libmpdemux/demux_mf.c
+++ b/libmpdemux/demux_mf.c
@@ -18,6 +18,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <strings.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index 1ba5ef5..1d5b2fa 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
 #include <assert.h>
 #include <math.h>
 #include <inttypes.h>
diff --git a/libmpdemux/demux_viv.c b/libmpdemux/demux_viv.c
index c937492..3040649 100644
--- a/libmpdemux/demux_viv.c
+++ b/libmpdemux/demux_viv.c
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h> /* strtok */
+#include <strings.h>
 
 #include "config.h"
 #include "mp_msg.h"
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index fbbd5e6..d6cb6ca 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 
 #include <sys/types.h>
diff --git a/libmpdemux/extension.c b/libmpdemux/extension.c
index 8ff5b64..1056c38 100644
--- a/libmpdemux/extension.c
+++ b/libmpdemux/extension.c
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 
 #include "config.h"
 #include "mp_msg.h"
diff --git a/libmpdemux/muxer_mpeg.c b/libmpdemux/muxer_mpeg.c
index c25e3a3..cd77381 100644
--- a/libmpdemux/muxer_mpeg.c
+++ b/libmpdemux/muxer_mpeg.c
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <inttypes.h>
 #include <string.h>
+#include <strings.h>
 #include <sys/types.h>
 
 #include "config.h"
diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c
index d40d628..89c6b69 100644
--- a/libvo/vo_aa.c
+++ b/libvo/vo_aa.c
@@ -31,6 +31,7 @@
 #include <stdarg.h>
 #include <time.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 
 #include "config.h"
diff --git a/libvo/vo_matrixview.c b/libvo/vo_matrixview.c
index 6f5d392..c23993a 100644
--- a/libvo/vo_matrixview.c
+++ b/libvo/vo_matrixview.c
@@ -25,6 +25,7 @@
 #include "config.h"
 
 #include <stdint.h>
+#include <strings.h>
 
 #include "mp_msg.h"
 #include "subopt-helper.h"
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
index ec673a4..c0cadc6 100644
--- a/libvo/vo_vdpau.c
+++ b/libvo/vo_vdpau.c
@@ -33,6 +33,7 @@
  */
 
 #include <stdio.h>
+#include <strings.h>
 
 #include "config.h"
 #include "sub/ass_mp.h"
diff --git a/libvo/vosub_vidix.c b/libvo/vosub_vidix.c
index 0fd5464..8154365 100644
--- a/libvo/vosub_vidix.c
+++ b/libvo/vosub_vidix.c
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 
 #include "config.h"
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 51c3669..04b8b97 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -29,6 +29,7 @@
 #include "x11_common.h"
 
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 #include <assert.h>
 
diff --git a/m_config.c b/m_config.c
index aa37be3..d7f60a5 100644
--- a/m_config.c
+++ b/m_config.c
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
+#include <strings.h>
 #ifdef MP_DEBUG
 #include <assert.h>
 #endif
diff --git a/m_option.c b/m_option.c
index 85f477e..5907c3e 100644
--- a/m_option.c
+++ b/m_option.c
@@ -23,6 +23,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <math.h>
 #include <stdio.h>
 #include <stdarg.h>
diff --git a/m_struct.c b/m_struct.c
index 7813340..fec45b5 100644
--- a/m_struct.c
+++ b/m_struct.c
@@ -23,6 +23,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 
 #include "m_option.h"
 #include "m_struct.h"
diff --git a/mencoder.c b/mencoder.c
index 6542be7..d84da18 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -50,6 +50,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <sys/time.h>
 #if defined(__MINGW32__) || defined(__CYGWIN__)
 #include <windows.h>
diff --git a/mp_msg.c b/mp_msg.c
index ac9682c..ec29a8e 100644
--- a/mp_msg.c
+++ b/mp_msg.c
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
+#include <strings.h>
 
 #include "config.h"
 #include "osdep/getch2.h"
diff --git a/mplayer.c b/mplayer.c
index 1324990..6423b93 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <time.h>
 #include <unistd.h>
 #include <assert.h>
diff --git a/parser-mpcmd.c b/parser-mpcmd.c
index 8697e19..4d29885 100644
--- a/parser-mpcmd.c
+++ b/parser-mpcmd.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 
 #ifdef MP_DEBUG
diff --git a/playtree.c b/playtree.c
index afad985..a8e036d 100644
--- a/playtree.c
+++ b/playtree.c
@@ -22,6 +22,7 @@
 #include "config.h"
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
diff --git a/playtreeparser.c b/playtreeparser.c
index 93039c8..d4bbe2c 100644
--- a/playtreeparser.c
+++ b/playtreeparser.c
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
 #include <assert.h>
 #include <errno.h>
 #include <sys/types.h>
diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c
index b100dbd..81dbc00 100644
--- a/stream/asf_streaming.c
+++ b/stream/asf_streaming.c
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 #include <errno.h>
 #include <limits.h>
diff --git a/stream/http.c b/stream/http.c
index 18533d5..ffa74e5 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 
 #if !HAVE_WINSOCK2_H
diff --git a/stream/librtsp/rtsp.c b/stream/librtsp/rtsp.c
index e02ae4c..1e464e9 100644
--- a/stream/librtsp/rtsp.c
+++ b/stream/librtsp/rtsp.c
@@ -34,6 +34,7 @@
 #include <assert.h>
 #include "config.h"
 #include <string.h>
+#include <strings.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c
index ca82209..96aec94 100644
--- a/stream/librtsp/rtsp_rtp.c
+++ b/stream/librtsp/rtsp_rtp.c
@@ -18,6 +18,7 @@
  *  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define _BSD_SOURCE
 #include <unistd.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/stream/network.c b/stream/network.c
index 6402a68..b853db7 100644
--- a/stream/network.c
+++ b/stream/network.c
@@ -23,6 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 
 #include <errno.h>
diff --git a/stream/stream_bd.c b/stream/stream_bd.c
index aa04081..23af765 100644
--- a/stream/stream_bd.c
+++ b/stream/stream_bd.c
@@ -20,6 +20,7 @@
  */
 
 #include <stdio.h>
+#include <strings.h>
 #include <limits.h>
 #include <ctype.h>
 #include "libavutil/common.h"
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index c9cddc1..216bf52 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 #include <string.h>
 
diff --git a/stream/stream_pvr.c b/stream/stream_pvr.c
index 09c9509..4e8bd21 100644
--- a/stream/stream_pvr.c
+++ b/stream/stream_pvr.c
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <strings.h>
 #include <ctype.h>
 #include <sys/time.h>
 #include <errno.h>
diff --git a/stream/tv.c b/stream/tv.c
index 604079a..0c230db 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <strings.h>
 #include <ctype.h>
 #include <sys/time.h>
 
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index a3be9e7..fc3ba0e 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -40,6 +40,7 @@ known issues:
 #include <pthread.h>
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <sys/time.h>
diff --git a/stream/udp.c b/stream/udp.c
index e27808b..d9b165b 100644
--- a/stream/udp.c
+++ b/stream/udp.c
@@ -22,6 +22,7 @@
 
 #include "config.h"
 
+#define _BSD_SOURCE
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
diff --git a/sub/font_load_ft.c b/sub/font_load_ft.c
index a04ddc4..8b6d662 100644
--- a/sub/font_load_ft.c
+++ b/sub/font_load_ft.c
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <math.h>
 #include <string.h>
+#include <strings.h>
 
 #ifdef CONFIG_ICONV
 #include <iconv.h>
diff --git a/sub/spudec.c b/sub/spudec.c
index a59306e..4610d5c 100644
--- a/sub/spudec.c
+++ b/sub/spudec.c
@@ -36,6 +36,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <strings.h>
 #include <math.h>
 #include "sub.h"
 #include "libvo/video_out.h"
diff --git a/sub/subassconvert.c b/sub/subassconvert.c
index a53c965..2478f43 100644
--- a/sub/subassconvert.c
+++ b/sub/subassconvert.c
@@ -19,6 +19,7 @@
  */
 
 #include <string.h>
+#include <strings.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/sub/subreader.c b/sub/subreader.c
index aa556b9..f49819a 100644
--- a/sub/subreader.c
+++ b/sub/subreader.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <ctype.h>
 
 #include <sys/types.h>
diff --git a/sub/vobsub.c b/sub/vobsub.c
index 654fd2d..98fd62d 100644
--- a/sub/vobsub.c
+++ b/sub/vobsub.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/stat.h>
diff --git a/subopt-helper.c b/subopt-helper.c
index b64ca30..2ee1060 100644
--- a/subopt-helper.c
+++ b/subopt-helper.c
@@ -40,6 +40,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <limits.h>
 #include <assert.h>
 
diff --git a/udp_sync.c b/udp_sync.c
index da736a8..3abdbf3 100644
--- a/udp_sync.c
+++ b/udp_sync.c
@@ -22,10 +22,12 @@
 #include "config.h"
 
 #if !HAVE_WINSOCK2_H
+#define _BSD_SOURCE
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
-- 
1.7.10



More information about the MPlayer-dev-eng mailing list