Skip to content

Commit f230037

Browse files
authored
Autotools: Refactor ext/standard strptime check (#14800)
- Cache variable renamed from ac_cv_strptime_decl_fails to php_cv_have_decl_strptime - CS synced
1 parent c6ab4b3 commit f230037

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

ext/standard/config.m4

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -343,24 +343,21 @@ AC_CHECK_FUNCS([posix_spawn_file_actions_addchdir_np])
343343
dnl
344344
dnl Check for strptime()
345345
dnl
346-
AC_CACHE_CHECK(whether strptime() declaration fails, ac_cv_strptime_decl_fails,[
347-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
348-
#include <time.h>
349-
]],[[
346+
AC_CACHE_CHECK([whether strptime is declared],
347+
[php_cv_have_decl_strptime],
348+
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [
350349
#ifndef HAVE_STRPTIME
351350
#error no strptime() on this platform
352351
#else
353352
/* use invalid strptime() declaration to see if it fails to compile */
354353
int strptime(const char *s, const char *format, struct tm *tm);
355354
#endif
356-
]])],[
357-
ac_cv_strptime_decl_fails=no
358-
],[
359-
ac_cv_strptime_decl_fails=yes
360-
])])
361-
if test "$ac_cv_strptime_decl_fails" = "yes"; then
362-
AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], 1, [whether strptime() declaration fails])
363-
fi
355+
])],
356+
[php_cv_have_decl_strptime=no],
357+
[php_cv_have_decl_strptime=yes])])
358+
AS_VAR_IF([php_cv_have_decl_strptime], [yes],
359+
[AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], [1],
360+
[Define to 1 if 'strptime' has declaration.])])
364361

365362
dnl
366363
dnl Check for argon2

0 commit comments

Comments
 (0)