[
FILE *f = fopen ("conftest.val", "w");
if (! f)
- exit (1);
+ return 1;
if (($2) < 0)
{
long int i = longval ();
if (i != ($2))
- exit (1);
+ return 1;
fprintf (f, "%ld\n", i);
}
else
{
unsigned long int i = ulongval ();
if (i != ($2))
- exit (1);
+ return 1;
fprintf (f, "%lu\n", i);
}
- exit (ferror (f) || fclose (f) != 0);
+ return ferror (f) || fclose (f) != 0;
])])
GCC=`test $ac_compiler_gnu = yes && echo yes`
_AC_PROG_CC_G
_AC_PROG_CC_C89
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-_AC_COMPILE_IFELSE([@%:@ifndef __cplusplus
- choke me
-@%:@endif],
- [_AC_PROG_CXX_EXIT_DECLARATION])
AC_LANG_POP(C)dnl
])# AC_PROG_CC
_AC_LANG_COMPILER_GNU
GXX=`test $ac_compiler_gnu = yes && echo yes`
_AC_PROG_CXX_G
-_AC_PROG_CXX_EXIT_DECLARATION
AC_LANG_POP(C++)dnl
])# AC_PROG_CXX
])# _AC_PROG_CXX_G
-# _AC_PROG_CXX_EXIT_DECLARATION
-# -----------------------------
-# If <stdlib.h> doesn't already provide a valid prototype for exit,
-# determine the appropriate prototype and put it in confdefs.h.
-# This macro is run only when testing a C++ compiler, but it generates
-# a prototype that is also appropriate for C compilers in order to
-# support a mixed C/C++ configuration environment.
-# We don't need to worry about this for C, since we include <stdlib.h>
-# if it is available, and that method works for all C compilers.
-m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
-[for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'extern "C" __declspec(dllimport) void exit (int);' \
- 'void exit (int);'
-do
- _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration
-@%:@include <stdlib.h>],
- [exit (42);])],
- [],
- [continue])
- _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
- [exit (42);])],
- [break])
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-])# _AC_PROG_CXX_EXIT_DECLARATION
-
-
# ------------------------------ #
# 3d. The Objective C compiler. #
# ------------------------------ #
char c[sizeof (long int)];
} u;
u.l = 1;
- exit (u.c[sizeof (long int) - 1] == 1);
+ return u.c[sizeof (long int) - 1] == 1;
]])],
[ac_cv_c_bigendian=no],
[ac_cv_c_bigendian=yes],
int
main ()
{
- exit (find_stack_direction () < 0);
+ return find_stack_direction () < 0;
}])],
[ac_cv_c_stack_direction=1],
[ac_cv_c_stack_direction=-1],
struct stat before, after;
if (creat (f, 0600) < 0)
- exit (1);
+ return 1;
if (stat (f, &before) < 0)
- exit (1);
+ return 1;
if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
- exit (1);
+ return 1;
if (stat (f, &after) < 0)
- exit (1);
- exit ((before.st_uid == after.st_uid
- && before.st_gid == after.st_gid) ? 0 : 1);
+ return 1;
+ return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid);
]])],
[ac_cv_func_chown_works=yes],
[ac_cv_func_chown_works=no],
int closedir ();
#endif
],
- [[exit (closedir (opendir (".")) != 0);]])],
+ [[return closedir (opendir (".")) != 0;]])],
[ac_cv_func_closedir_void=no],
[ac_cv_func_closedir_void=yes],
[ac_cv_func_closedir_void=yes])])
# define y(a, b, c) (fnmatch (a, b, c) == 0)
# define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
],
- [exit
+ [return
(!(y ("a*", "abc", 0)
&& n ("d*/*1", "d/s/1", FNM_PATHNAME)
&& y ("a\\\\bc", "abc", 0)
AC_CACHE_CHECK([for working getgroups], ac_cv_func_getgroups_works,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[/* On Ultrix 4.3, getgroups (0, 0) always fails. */
- exit (getgroups (0, 0) == -1 ? 1 : 0);]])],
+ return getgroups (0, 0) == -1;]])],
[ac_cv_func_getgroups_works=yes],
[ac_cv_func_getgroups_works=no],
[ac_cv_func_getgroups_works=no])
/* Linux will dereference the symlink and fail.
That is better in the sense that it means we will not
have to compile and use the lstat wrapper. */
- exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1);])],
+ return lstat ("conftest.sym/", &sbuf) != 0;])],
[ac_cv_func_lstat_dereferences_slashed_symlink=yes],
[ac_cv_func_lstat_dereferences_slashed_symlink=no],
[ac_cv_func_lstat_dereferences_slashed_symlink=no])
char *malloc ();
#endif
]],
- [exit (malloc (0) ? 0 : 1);])],
+ [return ! malloc (0);])],
[ac_cv_func_malloc_0_nonnull=yes],
[ac_cv_func_malloc_0_nonnull=no],
[ac_cv_func_malloc_0_nonnull=no])])
/* Some versions of memcmp are not 8-bit clean. */
char c0 = '\100', c1 = '\200', c2 = '\201';
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
- exit (1);
+ return 1;
/* The Next x86 OpenStep bug shows up only when comparing 16 bytes
or more and with at least one buffer not starting on a 4-byte boundary.
strcpy (a, "--------01111111");
strcpy (b, "--------10000000");
if (memcmp (a, b, 16) >= 0)
- exit (1);
+ return 1;
}
- exit (0);
+ return 0;
}
]])],
[ac_cv_func_memcmp_working=yes],
};
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
-/* Fail if mktime fails to convert a date in the spring-forward gap.
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
Based on a problem report from Andreas Jaeger. */
-static void
+static int
spring_forward_gap ()
{
/* glibc (up to about 1998-10-07) failed this test. */
tm.tm_min = 0;
tm.tm_sec = 0;
tm.tm_isdst = -1;
- if (mktime (&tm) == (time_t)-1)
- exit (1);
+ return mktime (&tm) != (time_t) -1;
}
-static void
+static int
mktime_test1 (now)
time_t now;
{
struct tm *lt;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
+ return ! (lt = localtime (&now)) || mktime (lt) == now;
}
-static void
+static int
mktime_test (now)
time_t now;
{
- mktime_test1 (now);
- mktime_test1 ((time_t) (time_t_max - now));
- mktime_test1 ((time_t) (time_t_min + now));
+ return (mktime_test1 (now)
+ && mktime_test1 ((time_t) (time_t_max - now))
+ && mktime_test1 ((time_t) (time_t_min + now)));
}
-static void
+static int
irix_6_4_bug ()
{
/* Based on code from Ariel Faigon. */
tm.tm_sec = 0;
tm.tm_isdst = -1;
mktime (&tm);
- if (tm.tm_mon != 2 || tm.tm_mday != 31)
- exit (1);
+ return tm.tm_mon == 2 && tm.tm_mday == 31;
}
-static void
+static int
bigtime_test (j)
int j;
{
&& lt->tm_wday == tm.tm_wday
&& ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
== (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
- exit (1);
+ return 0;
}
+ return 1;
}
int
putenv (tz_strings[i]);
for (t = 0; t <= time_t_max - delta; t += delta)
- mktime_test (t);
- mktime_test ((time_t) 1);
- mktime_test ((time_t) (60 * 60));
- mktime_test ((time_t) (60 * 60 * 24));
+ if (! mktime_test (t))
+ return 1;
+ if (! (mktime_test ((time_t) 1)
+ && mktime_test ((time_t) (60 * 60))
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ return 1;
for (j = 1; 0 < j; j *= 2)
- bigtime_test (j);
- bigtime_test (j - 1);
+ if (! bigtime_test (j))
+ return 1;
+ if (! bigtime_test (j - 1))
+ return 1;
}
- irix_6_4_bug ();
- spring_forward_gap ();
- exit (0);
+ return ! (irix_6_4_bug () && spring_forward_gap ());
}]])],
[ac_cv_func_working_mktime=yes],
[ac_cv_func_working_mktime=no],
/* First, make a file with some known garbage in it. */
data = (char *) malloc (pagesize);
if (!data)
- exit (1);
+ return 1;
for (i = 0; i < pagesize; ++i)
*(data + i) = rand ();
umask (0);
fd = creat ("conftest.mmap", 0600);
if (fd < 0)
- exit (1);
+ return 1;
if (write (fd, data, pagesize) != pagesize)
- exit (1);
+ return 1;
close (fd);
/* Next, try to mmap the file at a fixed address which already has
we see the same garbage. */
fd = open ("conftest.mmap", O_RDWR);
if (fd < 0)
- exit (1);
+ return 1;
data2 = (char *) malloc (2 * pagesize);
if (!data2)
- exit (1);
+ return 1;
data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit (1);
+ return 1;
for (i = 0; i < pagesize; ++i)
if (*(data + i) != *(data2 + i))
- exit (1);
+ return 1;
/* Finally, make sure that changes to the mapped area do not
percolate back to the file as seen by read(). (This is a bug on
*(data2 + i) = *(data2 + i) + 1;
data3 = (char *) malloc (pagesize);
if (!data3)
- exit (1);
+ return 1;
if (read (fd, data3, pagesize) != pagesize)
- exit (1);
+ return 1;
for (i = 0; i < pagesize; ++i)
if (*(data + i) != *(data3 + i))
- exit (1);
+ return 1;
close (fd);
- exit (0);
+ return 0;
}]])],
[ac_cv_func_mmap_fixed_mapped=yes],
[ac_cv_func_mmap_fixed_mapped=no],
char *realloc ();
#endif
]],
- [exit (realloc (0, 0) ? 0 : 1);])],
+ [return ! realloc (0, 0);])],
[ac_cv_func_realloc_0_nonnull=yes],
[ac_cv_func_realloc_0_nonnull=no],
[ac_cv_func_realloc_0_nonnull=no])])
[/* If this system has a BSD-style setpgrp which takes arguments,
setpgrp(1, 1) will fail with ESRCH and return -1, in that case
exit successfully. */
- exit (setpgrp (1,1) == -1 ? 0 : 1);])],
+ return setpgrp (1,1) != -1;])],
[ac_cv_func_setpgrp_void=no],
[ac_cv_func_setpgrp_void=yes],
[AC_MSG_ERROR([cannot check setpgrp when cross compiling])])])
[ac_cv_func_$1_empty_string_bug],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[struct stat sbuf;
- exit ($1 ("", &sbuf) ? 1 : 0);]])],
- [ac_cv_func_$1_empty_string_bug=yes],
+ return $1 ("", &sbuf) == 0;]])],
[ac_cv_func_$1_empty_string_bug=no],
+ [ac_cv_func_$1_empty_string_bug=yes],
[ac_cv_func_$1_empty_string_bug=yes])])
if test $ac_cv_func_$1_empty_string_bug = yes; then
AC_LIBOBJ([$1])
double value;
value = strtod (string, &term);
if (value != 69 || term != (string + 4))
- exit (1);
+ return 1;
}
{
char *term;
strtod (string, &term);
if (term != string && *(term - 1) == 0)
- exit (1);
+ return 1;
}
- exit (0);
+ return 0;
}
]])],
ac_cv_func_strtod=yes,
extern char *strerror_r ();],
[[char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
- exit (!isalpha (x));]])],
+ return ! isalpha (x);]])],
ac_cv_func_strerror_r_char_p=yes, , :)
fi
])
{
int expected = i <= S_LEN ? i : S_LEN;
if (strnlen (S, i) != expected)
- exit (1);
+ return 1;
}
- exit (0);
+ return 0;
]])],
[ac_cv_func_strnlen_working=yes],
[ac_cv_func_strnlen_working=no],
is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */
char buf;
if (setvbuf (stdout, _IOLBF, &buf, 1) != 0)
- exit (1);
+ return 1;
putchar ('\r');
- exit (0); /* Non-reversed systems SEGV here. */]])],
+ return 0; /* Non-reversed systems SEGV here. */]])],
[ac_cv_func_setvbuf_reversed=yes],
[],
[[: # Assume setvbuf is not reversed when cross-compiling.]])]
AC_DEFUN([AC_FUNC_STRCOLL],
[AC_CACHE_CHECK(for working strcoll, ac_cv_func_strcoll_works,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
- [[exit (strcoll ("abc", "def") >= 0 ||
+ [[return (strcoll ("abc", "def") >= 0 ||
strcoll ("ABC", "DEF") >= 0 ||
strcoll ("123", "456") >= 0)]])],
ac_cv_func_strcoll_works=yes,
# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[struct stat s, t;
- exit (!(stat ("conftest.data", &s) == 0
- && utime ("conftest.data", 0) == 0
- && stat ("conftest.data", &t) == 0
- && t.st_mtime >= s.st_mtime
- && t.st_mtime - s.st_mtime < 120));]])],
+ return ! (stat ("conftest.data", &s) == 0
+ && utime ("conftest.data", 0) == 0
+ && stat ("conftest.data", &t) == 0
+ && t.st_mtime >= s.st_mtime
+ && t.st_mtime - s.st_mtime < 120);]])],
ac_cv_func_utime_null=yes,
ac_cv_func_utime_null=no,
ac_cv_func_utime_null=no)])
[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[
/* By Ruediger Kuhlmann. */
- if (fork() < 0)
- exit (1);
- exit (0);
+ return fork () < 0;
])],
[ac_cv_func_fork_works=yes],
[ac_cv_func_fork_works=no],
while (wait(&status) != child)
;
- exit(
+ return (
/* Was there some problem with vforking? */
child < 0
wait3(&i, 0, &r);
/* Avoid "text file busy" from rm on fast HP-UX machines. */
sleep(2);
- exit (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
- && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
+ return (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
+ && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
}
}]])],
[ac_cv_func_wait3_rusage=yes],