Skip to content

Autotools: Refactor ext/standard strptime check #14800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -345,24 +345,21 @@ AC_CHECK_FUNCS([posix_spawn_file_actions_addchdir_np])
dnl
dnl Check for strptime()
dnl
AC_CACHE_CHECK(whether strptime() declaration fails, ac_cv_strptime_decl_fails,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <time.h>
]],[[
AC_CACHE_CHECK([whether strptime is declared],
[php_cv_have_decl_strptime],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [
#ifndef HAVE_STRPTIME
#error no strptime() on this platform
#else
/* use invalid strptime() declaration to see if it fails to compile */
int strptime(const char *s, const char *format, struct tm *tm);
#endif
]])],[
ac_cv_strptime_decl_fails=no
],[
ac_cv_strptime_decl_fails=yes
])])
if test "$ac_cv_strptime_decl_fails" = "yes"; then
AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], 1, [whether strptime() declaration fails])
fi
])],
[php_cv_have_decl_strptime=no],
[php_cv_have_decl_strptime=yes])])
AS_VAR_IF([php_cv_have_decl_strptime], [yes],
[AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], [1],
[Define to 1 if 'strptime' has declaration.])])

dnl
dnl Check for argon2
Expand Down
Loading