configure: include stddef.h for NULL

This fixes an observed failure to detect madvise() on Linux.

To avoid similar issues, all other tests that use NULL but don't already
have stddef.h (or another header that is defined to provide NULL,
such as stdio.h, unistd.h, or time.h) are also fixed.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Scott Wood 2010-10-05 14:28:17 -05:00 committed by Blue Swirl
parent bbf0a44081
commit 832ce9c286
1 changed files with 5 additions and 0 deletions

5
configure vendored
View File

@ -1329,6 +1329,7 @@ if test "$vnc_png" != "no" ; then
cat > $TMPC <<EOF cat > $TMPC <<EOF
//#include <stdio.h> //#include <stdio.h>
#include <png.h> #include <png.h>
#include <stddef.h>
int main(void) { int main(void) {
png_structp png_ptr; png_structp png_ptr;
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
@ -1513,6 +1514,7 @@ if test "$brlapi" != "no" ; then
brlapi_libs="-lbrlapi" brlapi_libs="-lbrlapi"
cat > $TMPC << EOF cat > $TMPC << EOF
#include <brlapi.h> #include <brlapi.h>
#include <stddef.h>
int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
EOF EOF
if compile_prog "" "$brlapi_libs" ; then if compile_prog "" "$brlapi_libs" ; then
@ -1747,6 +1749,7 @@ if test "$linux_aio" != "no" ; then
cat > $TMPC <<EOF cat > $TMPC <<EOF
#include <libaio.h> #include <libaio.h>
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include <stddef.h>
int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; }
EOF EOF
if compile_prog "" "-laio" ; then if compile_prog "" "-laio" ; then
@ -2127,6 +2130,7 @@ madvise=no
cat > $TMPC << EOF cat > $TMPC << EOF
#include <sys/types.h> #include <sys/types.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <stddef.h>
int main(void) { return madvise(NULL, 0, MADV_DONTNEED); } int main(void) { return madvise(NULL, 0, MADV_DONTNEED); }
EOF EOF
if compile_prog "" "" ; then if compile_prog "" "" ; then
@ -2139,6 +2143,7 @@ fi
posix_madvise=no posix_madvise=no
cat > $TMPC << EOF cat > $TMPC << EOF
#include <sys/mman.h> #include <sys/mman.h>
#include <stddef.h>
int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }
EOF EOF
if compile_prog "" "" ; then if compile_prog "" "" ; then