From 7dba5940ae0b4d8b82b5497717accaa03ee66f1c Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Thu, 22 Nov 2012 22:49:11 +0100 Subject: [PATCH] Issue #13057: Include stdio.h when NULL is used in configure.ac. --- configure | 10 +++++++++- configure.ac | 12 ++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 4a861ed2c95..534c8df4168 100755 --- a/configure +++ b/configure @@ -6562,6 +6562,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include #include void* routine(void* p){return NULL;} @@ -6617,6 +6618,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include #include void* routine(void* p){return NULL;} @@ -6666,6 +6668,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include #include void* routine(void* p){return NULL;} @@ -6715,6 +6718,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include #include void* routine(void* p){return NULL;} @@ -9323,6 +9327,8 @@ $as_echo "$unistd_defines_pthreads" >&6; } $as_echo_n "checking for pthread_create in -lpthread... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + +#include #include void * start_routine (void *arg) { exit (0); } @@ -9672,7 +9678,9 @@ else else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + + #include + #include void *foo(void *parm) { return NULL; } diff --git a/configure.ac b/configure.ac index 819bb60c510..862d694e75b 100644 --- a/configure.ac +++ b/configure.ac @@ -1345,6 +1345,7 @@ fi AC_MSG_CHECKING(whether pthreads are available without options) AC_CACHE_VAL(ac_cv_pthread_is_default, [AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include #include void* routine(void* p){return NULL;} @@ -1379,6 +1380,7 @@ AC_CACHE_VAL(ac_cv_kpthread, [ac_save_cc="$CC" CC="$CC -Kpthread" AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include #include void* routine(void* p){return NULL;} @@ -1407,6 +1409,7 @@ AC_CACHE_VAL(ac_cv_kthread, [ac_save_cc="$CC" CC="$CC -Kthread" AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include #include void* routine(void* p){return NULL;} @@ -1435,6 +1438,7 @@ AC_CACHE_VAL(ac_cv_thread, [ac_save_cc="$CC" CC="$CC -pthread" AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include #include void* routine(void* p){return NULL;} @@ -2356,7 +2360,9 @@ yes _libs=$LIBS LIBS="$LIBS -lpthread" AC_MSG_CHECKING([for pthread_create in -lpthread]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#include +#include void * start_routine (void *arg) { exit (0); }]], [[ pthread_create (NULL, NULL, start_routine, NULL)]])],[ @@ -2422,7 +2428,9 @@ if test "$posix_threads" = "yes"; then AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported) AC_CACHE_VAL(ac_cv_pthread_system_supported, - [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include void *foo(void *parm) { return NULL; }