Fix ctime_r nargs detection to return 0 if no prototype is available.

This commit is contained in:
Kurt Zeilenga 1999-10-30 21:07:03 +00:00
parent e20d6dfb8b
commit ae302ec787
2 changed files with 481 additions and 445 deletions

View file

@ -910,13 +910,31 @@ AC_DEFUN(OL_FUNC_CTIME_R_NARGS,
[AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs, [AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs,
[AC_TRY_COMPILE([#include <time.h>], [AC_TRY_COMPILE([#include <time.h>],
[time_t ti; char *buffer; ctime_r(&ti,buffer,32);], [time_t ti; char *buffer; ctime_r(&ti,buffer,32);],
ol_cv_func_ctime_r_nargs=3, ol_cv_func_ctime_r_nargs3=yes,
[AC_TRY_COMPILE([#include <time.h>], ol_cv_func_ctime_r_nargs3=no)
[time_t ti; char *buffer; ctime_r(&ti,buffer);],
ol_cv_func_ctime_r_nargs=2, AC_TRY_COMPILE([#include <time.h>],
ol_cv_func_ctime_r_nargs=0)])]) [time_t ti; char *buffer; ctime_r(&ti,buffer);],
ol_cv_func_ctime_r_nargs2=yes,
ol_cv_func_ctime_r_nargs2=no)
if test $ol_cv_func_ctime_r_nargs3 = yes -a \
$ol_cv_func_ctime_r_nargs2 = no ; then
ol_cv_func_ctime_r_nargs=3
elif test $ol_cv_func_ctime_r_nargs3 = no -a \
$ol_cv_func_ctime_r_nargs2 = yes ; then
ol_cv_func_ctime_r_nargs=2
else
ol_cv_func_ctime_r_nargs=0
fi
])
if test $ol_cv_func_ctime_r_nargs -gt 1 ; then if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs, AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs,
[set to the number of arguments ctime_r() expects]) [set to the number of arguments ctime_r() expects])
fi fi
])dnl ])dnl

896
configure vendored

File diff suppressed because it is too large Load diff