Bug 426205 - Fix implicit declaration of exit() warning running configure r=bsmedberg a=beltzner
--- a/build/autoconf/altoptions.m4
+++ b/build/autoconf/altoptions.m4
@@ -117,17 +117,18 @@ dnl Apparently, some systems cannot prop
dnl library unless <pthread.h> is included so we need to test
dnl using it
dnl
dnl MOZ_CHECK_PTHREADS(lib, success, failure)
AC_DEFUN([MOZ_CHECK_PTHREADS],
[
AC_MSG_CHECKING([for pthread_create in -l$1])
echo "
- #include <pthread.h>
+ #include <pthread.h>
+ #include <stdlib.h>
void *foo(void *v) { int a = 1; }
int main() {
pthread_t t;
if (!pthread_create(&t, 0, &foo, 0)) {
pthread_join(t, 0);
}
exit(0);
}" > dummy.c ;
--- a/configure.in
+++ b/configure.in
@@ -7887,16 +7887,17 @@ if test "$COMPILE_ENVIRONMENT"; then
if test "$MOZ_X11"; then
dnl ====================================================
dnl = Check if X headers exist
dnl ====================================================
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $XCFLAGS"
AC_TRY_COMPILE([
#include <stdio.h>
+ #include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
],
[
Display *dpy = 0;
if ((dpy = XOpenDisplay(NULL)) == NULL) {
fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
exit(1);