[FFmpeg-devel] [PATCH] -D_POSIX_C_SOURCE=200112 and OS/2

Måns Rullgård mans
Sat Aug 16 04:07:20 CEST 2008


Dave Yeo <daveryeo at telus.net> writes:

> Hi, with -D_POSIX_C_SOURCE=200112 on OS/2 we get this error,
>> gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
>> -I.
> -I"/usr/src/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -fasm
> -std=c99 -fomit-frame-pointer -g -Wall -Wno-switch
> -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wcast-qual
> -Wwrite-strings -O3 -fno-math-errno       -c -o
> libavformat/os_support.o libavformat/os_support.c
> libavformat/os_support.c: In function `poll':
> libavformat/os_support.c:141: error: storage size of `tv' isn't known
> libavformat/os_support.c:141: warning: unused variable `tv'
>
> Fix is to include sys/time.h as in one of the attached patches. Not
> sure if checking for existence of sys/time.h is needed but the
> autotools usually do check.

sys/time.h is a standard header, so there should be no need to check
for it.  Besides, where would struct timeval be defined if the header
doesn't exist?  If a system that defines it elsewhere turns up, we'll
deal with it then.

> Index: libavformat/os_support.c
> ===================================================================
> --- libavformat/os_support.c	(revision 14783)
> +++ libavformat/os_support.c	(working copy)
> @@ -27,6 +27,7 @@
>  #include "avformat.h"
>  #include <unistd.h>
>  #include <fcntl.h>
> +#include <sys/time.h>
>  #include "os_support.h"
>  
>  #ifdef CONFIG_NETWORK

OK

> Index: configure
> ===================================================================
> --- configure	(revision 14783)
> +++ configure	(working copy)
> @@ -786,6 +786,7 @@
>      sys_resource_h
>      sys_select_h
>      sys_soundcard_h
> +    sys_time_h
>      termios_h
>      threads
>      winsock2_h
> @@ -1648,6 +1649,7 @@
>  check_header sys/mman.h
>  check_header sys/resource.h
>  check_header sys/select.h
> +check_header sys/time.h
>  check_header termios.h
>  
>  if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
> Index: libavformat/os_support.c
> ===================================================================
> --- libavformat/os_support.c	(revision 14783)
> +++ libavformat/os_support.c	(working copy)
> @@ -27,6 +27,9 @@
>  #include "avformat.h"
>  #include <unistd.h>
>  #include <fcntl.h>
> +#ifdef HAVE_SYS_TIME_H
> +#include <sys/time.h>
> +#endif
>  #include "os_support.h"
>  
>  #ifdef CONFIG_NETWORK

Not necessary.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list