[FFmpeg-cvslog] r14754 - trunk/configure

Aurelien Jacobs aurel
Fri Aug 15 00:23:23 CEST 2008


D wrote:

> On Aug 14, 2008, at 7:40 AM, michael wrote:
> 
> > Author: michael
> > Date: Thu Aug 14 13:40:14 2008
> > New Revision: 14754
> >
> > Log:
> > Add -D_POSIX_C_SOURCE=200112 to cflags.
> 
> This breaks on Mac OS X as such:
> 
> gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. - 
> I"/Users/lessen/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 - 
> pipe -force_cpusubtype_ALL -Wno-sign-compare -mdynamic-no-pic -fomit- 
> frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-switch - 
> Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer- 
> sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno       -c -o  
> libavformat/os_support.o /Users/davedc/Projects/ffmpeg-git/libavformat/ 
> os_support.c
> /Users/davedc/Projects/ffmpeg-git/libavformat/os_support.c: In  
> function ?resolve_host?:
> /Users/davedc/Projects/ffmpeg-git/libavformat/os_support.c:63:  
> warning: implicit declaration of function ?inet_aton?
> /Users/davedc/Projects/ffmpeg-git/libavformat/os_support.c:67: error:  
> ?struct hostent? has no member named ?h_addr?
> make: *** [libavformat/os_support.o] Error 1
> 
> 
> It seems the problem is that the h_addr compatibilty macro and  
> inet_aton are not defined at all in the 10.4 headers if  
> _POSIX_C_SOURCE is. 10.5 headers define them when _POSIX_C_SOURCE is  
> defined only if _DARWIN_C_SOURCE is also defined.
> 
> Apparently this was a deliberate change from 10.3 which supposedly  
> does not have these conditions, as evidenced by lynx having the same  
> problem over 3 years ago ( http://www.mail-archive.com/lynx-dev at nongnu.org/msg00950.html 
>   )
> 
> Two possible solutions I see: don't define _POSIX_C_SOURCE on Darwin  
> or use h_addr_list[0] rather than h_addr.

I guess h_addr_list[0] is the way to go. h_addr is not posix:
http://www.opengroup.org/onlinepubs/000095399/basedefs/netdb.h.html

Anyone against the attached patch ?
I fear this might break some very old, non-posix systems. But the
best way to find it out, is probably to commit it.

Aurel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h_addr.diff
Type: text/x-patch
Size: 448 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080815/ebf6d7ee/attachment.bin>



More information about the ffmpeg-cvslog mailing list