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

David Conrad lessen42
Sun Mar 7 08:18:22 CET 2010


On Mar 7, 2010, at 1:42 AM, M?ns Rullg?rd wrote:

> 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...

Something like this?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: textmate stdin ESTjJb.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100307/8677db31/attachment.txt>



More information about the ffmpeg-devel mailing list