On 2011-12-27 11:12:14 +0000, Måns Rullgård wrote:
> Janne Grunau <[email protected]> writes:
> 
> > @@ -2857,9 +2858,10 @@ check_func  strerror_r
> >  check_func  strptime
> >  check_func  strtok_r
> >  check_func  sched_getaffinity
> > -check_func  sysctl
> >  check_func_headers io.h setmode
> >  check_func_headers lzo/lzo1x.h lzo1x_999_compress
> > +check_func_headers "sys/types.h sys/sysctl.h" sysctl ||
> > +    check_func_headers "sys/param.h sys/sysctl.h" sysctl
> >  check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
> >  check_func_headers windows.h GetProcessTimes
> >  check_func_headers windows.h GetSystemInfo
> 
> This looks unnecessary and probably wrong.  It will fail to detect
> sysctl if sys/param.h doesn't exist.  I don't know if a system exists
> with sysctl but without sys/param.h, but Linux sysctl does not need this
> header, so testing for it like this is wrong.

Have you missed the '||' it tests for sysctl first using sys/types.h
and sys/sysctl.h. If that fails like on OpenBSD it tests again with
sys/param.h and sys/sysctl.h.

I could add a comment and I'm open to suggestions how to write the test
in an easier way.

check_func_headers "sys/types.h sys/sysctl.h" sysctl
! enabled sysctl && check_func_headers "sys/param.h sys/sysctl.h" sysctl

is not really better.

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to