[alsa-devel] [PATCH 3/3] Define _GNU_SOURCE so that <fcntl.h> gives O_CLOEXEC

Rémi Denis-Courmont remi at remlab.net
Sun Nov 8 16:23:36 CET 2009


Le dimanche 8 novembre 2009 16:49:37 Lennart Poettering, vous avez écrit :
> On Thu, 05.11.09 21:17, Rémi Denis-Courmont (remi at remlab.net) wrote:
> > Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> > ---
> >  configure.in |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/configure.in b/configure.in
> > index a455de1..cc8950f 100644
> > --- a/configure.in
> > +++ b/configure.in
> > @@ -38,6 +38,8 @@ then
> >    AC_MSG_RESULT($CC)
> >  fi
> >
> > +CFLAGS="$CFLAGS -D_GNU_SOURCE"
> 
> There's acually an autoconf macro for this. AC_GNU_SOURCE. And even
> better than that is usually AC_SYSTEM_EXTENSIONS.

AC_SYSTEM_EXTENSIONS is not much extra help from AC_GNU_SOURCE in a Linux-only 
library. alsa-lib does not systematically include <config.h> first, so neither 
of them will work anyway.

I did not dare to make such a big change. We need _GNU_SOURCE before *any* 
system header is included. Hence I added it to C(PP)FLAGS.

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the Alsa-devel mailing list