mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Fix ctime_r nargs detection to return 0 if no prototype is available.
This commit is contained in:
parent
e20d6dfb8b
commit
ae302ec787
2 changed files with 481 additions and 445 deletions
|
|
@ -910,11 +910,29 @@ AC_DEFUN(OL_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>],
|
||||
[time_t ti; char *buffer; ctime_r(&ti,buffer,32);],
|
||||
ol_cv_func_ctime_r_nargs=3,
|
||||
[AC_TRY_COMPILE([#include <time.h>],
|
||||
ol_cv_func_ctime_r_nargs3=yes,
|
||||
ol_cv_func_ctime_r_nargs3=no)
|
||||
|
||||
AC_TRY_COMPILE([#include <time.h>],
|
||||
[time_t ti; char *buffer; ctime_r(&ti,buffer);],
|
||||
ol_cv_func_ctime_r_nargs=2,
|
||||
ol_cv_func_ctime_r_nargs=0)])])
|
||||
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
|
||||
AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs,
|
||||
[set to the number of arguments ctime_r() expects])
|
||||
|
|
|
|||
Loading…
Reference in a new issue