[FFmpeg-devel] [PATCH v3 1/1] configure: Refactor setting of feature test macro _XOPEN_SOURCE

wm4 nfxjfg at googlemail.com
Mon Sep 22 18:39:51 CEST 2014


On Mon, 22 Sep 2014 18:31:36 +0200
Michael Niedermayer <michaelni at gmx.at> wrote:

> On Mon, Sep 22, 2014 at 06:19:42PM +0200, wm4 wrote:
> > On Mon, 22 Sep 2014 17:13:24 +0200
> > Michael Niedermayer <michaelni at gmx.at> wrote:
> > 
> > > On Sun, Sep 21, 2014 at 10:48:01PM +0200, Jörg Krause wrote:
> > > > Some C libraries, eg glibc, uclibc, and musl, uses feature test macros 
> > > > to expose definitions conforming to the standards ISO C, POSIX and 
> > > > extensions. According to which feature test macros are defined by the 
> > > > user or the compiler, a header file, eg <features.h>, used by these 
> > > > libraries internally defines various other macros.
> > > > 
> > > > glibc and uclibc also defines release test macros, eg __GLIBC__ and
> > > > __UCLIBC__ in <features.h>. musl does not have (and does not want) a 
> > > > macro __MUSL__. Therefore it is not possible to check for the musl
> > > > library.
> > > > 
> > > > However, building FFmpeg with musl needs the feature test macro
> > > > _XOPEN_SOURCE=600 to be defined.
> > > > 
> > > > Signed-off-by: Jörg Krause <jkrause at posteo.de>
> > > > ---
> > > > Changes v2 -> v3:
> > > >   - set _XOPEN_SOURCE as default in case no C library can be detected
> > > > 
> > > > Changes v1 -> v2:
> > > >   - do not set _XOPEN_SOURCE twice for glibc and uclibc
> > > > ---
> > > >  configure | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > 
> > > patch reverted
> > > it broke netbsd and macosx at least
> > > see
> > > http://fate.ffmpeg.org/log.cgi?time=20140922033546&log=compile&slot=i386-darwin-gcc-4.7
> > > 
> > > [...]
> > > 
> > 
> > It looks like the code uses inet_aton even if getaddrinfo is available.
> > 
> > Should the code using inet_aton just not be compiled if HAVE_GETADDRINFO
> > is not 0?
> 
> the code uses inet_aton() when HAVE_INET_ATON is set
> it is set but the code fails to build (on netbsd at least but probably
> the failure on the other bsds is similar)
> 
> [...]

What I meant is that it could be moved inside of
the "#if !HAVE_GETADDRINFO" block. Only the getaddrinfo emulation uses
ff_inet_aton.

(I'm assuming OSX and the BSDs have getaddrinfo().)

Unless I misunderstood the problem.


More information about the ffmpeg-devel mailing list