Diego Biurrun <[email protected]> writes:

> On Fri, May 20, 2011 at 04:57:08PM +0100, Måns Rullgård wrote:
>> Diego Biurrun <[email protected]> writes:
>> 
>> > On Fri, May 20, 2011 at 04:20:26PM +0100, Måns Rullgård wrote:
>> >> Diego Biurrun <[email protected]> writes:
>> >> 
>> >> > On some platforms the -std=c99 gcc option hides certain functions from 
>> >> > system
>> >> > header files because the option turns on the __STRICT_ANSI__ 
>> >> > preprocessor flag.
>> >> >
>> >> > Unset the flag globally if doing so makes these system functions 
>> >> > visible.
>> >> > ---
>> >> >  configure |    4 +++-
>> >> >  1 files changed, 3 insertions(+), 1 deletions(-)
>> >> >
>> >> > --- a/configure
>> >> > +++ b/configure
>> >> > @@ -2326,6 +2326,9 @@ fi
>> >> >  
>> >> >  add_cppflags -D_ISOC99_SOURCE
>> >> >  check_cflags -std=c99
>> >> > +if ! check_func atoll; then
>> >> > +    check_func atoll -U__STRICT_ANSI__ && add_cppflags 
>> >> > -U__STRICT_ANSI__
>> >> > +fi
>> >> 
>> >> Why that function?  atoll() is a standard C function so even retarded
>> >> headers should provide a declaration in the strictest mode.
>> >
>> > On Cygwin this is one of the functions hidden by __STRICT_ANSI__ ifndefs
>> > and we actually use it in Libav, so it seemed the sanest choice.
>> 
>> The test still makes no sense.  If that's the only way to "detect" it,
>> I'd rather leave it alone.
>
> How would you check for it?
>
> At the point I check, -std=c99 is already in CFLAGS, which implies -ansi,
> which on some systems hides certain standard functions, one of which is
> atoll().  So I check if atoll() is hidden and if it is hidden, I check if
> it reappears with -U__STRICT_ANSI__.  If it does, I assume we are on one
> of those systems that has atoll() below ansi ifndefs and add the flag
> to CPPFLAGS.
>
> Now if you have a smarter suggestion, I'm all ears, but what I came up
> with makes sense to me...

Leave it alone.  Do nothing.  Don't touch it.  Do nothing.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to