]> granicus.if.org Git - php/commitdiff
Remove AC_STRUCT_TM macro
authorPeter Kokot <peterkokot@gmail.com>
Sun, 26 Aug 2018 04:21:04 +0000 (06:21 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Wed, 29 Aug 2018 19:22:47 +0000 (21:22 +0200)
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 `<sys/time.h>` or
`<time.h>` 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 `<time.h>` 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

acinclude.m4
configure.ac
ext/standard/crypt.c
ext/standard/head.c

index 1deb50d2983c5e3fc99ab8cc62b0557a92721374..626031c289559a96c7e7aa8e5dbf64844b671e45 100644 (file)
@@ -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 <sys/types.h>
-#include <$ac_cv_struct_tm>]], [[struct tm tm; tm.tm_gmtoff;]])],
+#include <time.h>]], [[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
index 7249f59f966a4c25cc2dd65f8e9e337dc2ed7c1d..b8350feb6054c8ef4f7338ef0278a621f900319f 100644 (file)
@@ -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
index 64ad0c1435a120d72be7e5ab931643e4c2de066e..cc9597a28ee3df7f0a2c01ffd6fd0205dec95553 100644 (file)
 #  include <crypt.h>
 # endif
 #endif
-#if TM_IN_SYS_TIME
-#include <sys/time.h>
-#else
 #include <time.h>
-#endif
 #if HAVE_STRING_H
 #include <string.h>
 #else
index 7c813c47833dc35e5b8503c1defe799df94397c0..302599f02ba5583fb9dd57ce16f7c6233e267fb5 100644 (file)
 #include "SAPI.h"
 #include "php_main.h"
 #include "head.h"
-#ifdef TM_IN_SYS_TIME
-#include <sys/time.h>
-#else
 #include <time.h>
-#endif
 
 #include "php_globals.h"