[FFmpeg-devel] [PATCH] Fix the build on OS X + clang

Måns Rullgård mans
Sun Mar 7 07:42:29 CET 2010


David Conrad <lessen42 at gmail.com> writes:

> Hi,
>
> OS X hides the prototype for inet_aton if _POSIX_C_SOURCE is defined
> and _DARWIN_C_SOURCE is not. With -Werror=implicit, this turns into
> a hard error for clang (gcc 4.2 still only warns about this)
>
>
> commit 7d2daa83cf0fb07cbcae09a39f2c56023e828144
> Author: David Conrad <lessen42 at gmail.com>
> Date:   Sat Mar 6 21:19:24 2010 -0500
>
>     inet_aton needs _DARWIN_C_SOURCE on OS X
>
> diff --git a/libavformat/os_support.c b/libavformat/os_support.c
> index 4bf2e26..13986d5 100644
> --- a/libavformat/os_support.c
> +++ b/libavformat/os_support.c
> @@ -22,6 +22,7 @@
>
>  /* needed by inet_aton() */
>  #define _SVID_SOURCE
> +#define _DARWIN_C_SOURCE
>
>  #include "config.h"
>  #include "avformat.h"

If that's what it takes...  os_support.c is where hacks go, so I guess
it's OK.

> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index c7c6fc3..7403653 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -21,6 +21,7 @@
>
>  /* needed by inet_aton() */
>  #define _SVID_SOURCE
> +#define _DARWIN_C_SOURCE
>
>  #include "libavutil/base64.h"
>  #include "libavutil/avstring.h"

This doesn't belong in rtsp.c, nor does the _SVID_SOURCE.  Maybe we
need to change something...

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



More information about the ffmpeg-devel mailing list