Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7dba594

Browse files
author
Stefan Krah
committed
Issue #13057: Include stdio.h when NULL is used in configure.ac.
1 parent 5bd9270 commit 7dba594

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

configure

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6562,6 +6562,7 @@ else
65626562
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65636563
/* end confdefs.h. */
65646564
6565+
#include <stdio.h>
65656566
#include <pthread.h>
65666567
65676568
void* routine(void* p){return NULL;}
@@ -6617,6 +6618,7 @@ else
66176618
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66186619
/* end confdefs.h. */
66196620
6621+
#include <stdio.h>
66206622
#include <pthread.h>
66216623
66226624
void* routine(void* p){return NULL;}
@@ -6666,6 +6668,7 @@ else
66666668
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66676669
/* end confdefs.h. */
66686670
6671+
#include <stdio.h>
66696672
#include <pthread.h>
66706673
66716674
void* routine(void* p){return NULL;}
@@ -6715,6 +6718,7 @@ else
67156718
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
67166719
/* end confdefs.h. */
67176720
6721+
#include <stdio.h>
67186722
#include <pthread.h>
67196723
67206724
void* routine(void* p){return NULL;}
@@ -9323,6 +9327,8 @@ $as_echo "$unistd_defines_pthreads" >&6; }
93239327
$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
93249328
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
93259329
/* end confdefs.h. */
9330+
9331+
#include <stdio.h>
93269332
#include <pthread.h>
93279333
93289334
void * start_routine (void *arg) { exit (0); }
@@ -9672,7 +9678,9 @@ else
96729678
else
96739679
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
96749680
/* end confdefs.h. */
9675-
#include <pthread.h>
9681+
9682+
#include <stdio.h>
9683+
#include <pthread.h>
96769684
void *foo(void *parm) {
96779685
return NULL;
96789686
}

configure.ac

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,7 @@ fi
13451345
AC_MSG_CHECKING(whether pthreads are available without options)
13461346
AC_CACHE_VAL(ac_cv_pthread_is_default,
13471347
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
1348+
#include <stdio.h>
13481349
#include <pthread.h>
13491350
13501351
void* routine(void* p){return NULL;}
@@ -1379,6 +1380,7 @@ AC_CACHE_VAL(ac_cv_kpthread,
13791380
[ac_save_cc="$CC"
13801381
CC="$CC -Kpthread"
13811382
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1383+
#include <stdio.h>
13821384
#include <pthread.h>
13831385
13841386
void* routine(void* p){return NULL;}
@@ -1407,6 +1409,7 @@ AC_CACHE_VAL(ac_cv_kthread,
14071409
[ac_save_cc="$CC"
14081410
CC="$CC -Kthread"
14091411
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1412+
#include <stdio.h>
14101413
#include <pthread.h>
14111414
14121415
void* routine(void* p){return NULL;}
@@ -1435,6 +1438,7 @@ AC_CACHE_VAL(ac_cv_thread,
14351438
[ac_save_cc="$CC"
14361439
CC="$CC -pthread"
14371440
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1441+
#include <stdio.h>
14381442
#include <pthread.h>
14391443
14401444
void* routine(void* p){return NULL;}
@@ -2356,7 +2360,9 @@ yes
23562360
_libs=$LIBS
23572361
LIBS="$LIBS -lpthread"
23582362
AC_MSG_CHECKING([for pthread_create in -lpthread])
2359-
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>
2363+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2364+
#include <stdio.h>
2365+
#include <pthread.h>
23602366
23612367
void * start_routine (void *arg) { exit (0); }]], [[
23622368
pthread_create (NULL, NULL, start_routine, NULL)]])],[
@@ -2422,7 +2428,9 @@ if test "$posix_threads" = "yes"; then
24222428

24232429
AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
24242430
AC_CACHE_VAL(ac_cv_pthread_system_supported,
2425-
[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <pthread.h>
2431+
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
2432+
#include <stdio.h>
2433+
#include <pthread.h>
24262434
void *foo(void *parm) {
24272435
return NULL;
24282436
}

0 commit comments

Comments
 (0)