From: Peter Kokot Date: Sun, 26 Aug 2018 04:21:04 +0000 (+0200) Subject: Remove AC_STRUCT_TM macro X-Git-Tag: php-7.4.0alpha1~2030 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbc785dc8c89a5ff085909e555d677d4d8d7c9a1;p=php Remove AC_STRUCT_TM macro Autoconf 2.59d (released in 2006) [1] started promoting several macros as not relevant for newer systems anymore, including the `AC_STRUCT_TM`. This macro checks if `struct tm` is defined in either `` or `` and defines the `TM_IN_SYS_TIME` symbol accordingly. This check was relevant in times before the C89 for some embedded systems, microcontrollers or very old systems. For newer systems it can be avoided and the `` should be included instead since current systems should be well supported by now. [2] Since PHP requires at least C89, this patch removes the obsolescent call and time.h checks. Refs: - [1]: http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS - [2]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Structures.html --- diff --git a/acinclude.m4 b/acinclude.m4 index 1deb50d298..626031c289 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1402,7 +1402,7 @@ dnl AC_DEFUN([PHP_TM_GMTOFF],[ AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include <$ac_cv_struct_tm>]], [[struct tm tm; tm.tm_gmtoff;]])], +#include ]], [[struct tm tm; tm.tm_gmtoff;]])], [ac_cv_struct_tm_gmtoff=yes], [ac_cv_struct_tm_gmtoff=no])]) if test "$ac_cv_struct_tm_gmtoff" = yes; then diff --git a/configure.ac b/configure.ac index 7249f59f96..b8350feb60 100644 --- a/configure.ac +++ b/configure.ac @@ -507,7 +507,6 @@ PHP_BROKEN_GLIBC_FOPEN_APPEND dnl Checks for typedefs, structures, and compiler characteristics. dnl ------------------------------------------------------------------------- -AC_STRUCT_TM AC_STRUCT_TIMEZONE PHP_MISSING_TIME_R_DECL diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 64ad0c1435..cc9597a28e 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -37,11 +37,7 @@ # include # endif #endif -#if TM_IN_SYS_TIME -#include -#else #include -#endif #if HAVE_STRING_H #include #else diff --git a/ext/standard/head.c b/ext/standard/head.c index 7c813c4783..302599f02b 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -23,11 +23,7 @@ #include "SAPI.h" #include "php_main.h" #include "head.h" -#ifdef TM_IN_SYS_TIME -#include -#else #include -#endif #include "php_globals.h"