mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Declare timezone only, if the system fails to do so.
This commit is contained in:
parent
3dce6028f7
commit
2fd8cbff2a
6 changed files with 23 additions and 9 deletions
|
@ -1,7 +1,5 @@
|
||||||
/* This is the default configuration file to read -*- C -*- */
|
/* This is the default configuration file to read -*- C -*- */
|
||||||
|
|
||||||
#undef socklen_t
|
|
||||||
|
|
||||||
/* these are defined by automake */
|
/* these are defined by automake */
|
||||||
#undef PACKAGE
|
#undef PACKAGE
|
||||||
#undef VERSION
|
#undef VERSION
|
||||||
|
|
19
acinclude.m4
19
acinclude.m4
|
@ -484,3 +484,22 @@ AC_DEFUN(PHP_OUTPUT,[
|
||||||
PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1"
|
PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_DEFUN(PHP_DECLARED_TIMEZONE,[
|
||||||
|
AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <time.h>
|
||||||
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
],[
|
||||||
|
time_t foo = (time_t) timezone;
|
||||||
|
],[
|
||||||
|
ac_cv_declared_timezone=yes
|
||||||
|
],[
|
||||||
|
ac_cv_declared_timezone=no
|
||||||
|
])])
|
||||||
|
if test "$ac_cv_declared_timezone" = "yes"; then
|
||||||
|
AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
|
@ -335,6 +335,7 @@ AC_REPLACE_FUNCS(strlcat strlcpy getopt)
|
||||||
AC_FUNC_UTIME_NULL
|
AC_FUNC_UTIME_NULL
|
||||||
AC_FUNC_ALLOCA
|
AC_FUNC_ALLOCA
|
||||||
AC_BROKEN_SPRINTF
|
AC_BROKEN_SPRINTF
|
||||||
|
PHP_DECLARED_TIMEZONE
|
||||||
|
|
||||||
dnl AIX keeps in_addr_t in /usr/include/netinet/in.h
|
dnl AIX keeps in_addr_t in /usr/include/netinet/in.h
|
||||||
dnl AC_MSG_CHECKING(for in_addr_t)
|
dnl AC_MSG_CHECKING(for in_addr_t)
|
||||||
|
|
|
@ -53,7 +53,7 @@ char *day_short_names[] =
|
||||||
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
|
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE) && !(WIN32||WINNT)
|
#if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE) && !defined(HAVE_DECLARED_TIMEZONE)
|
||||||
extern time_t timezone;
|
extern time_t timezone;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -46,14 +46,9 @@
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WIN32||WINNT
|
#if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE) && !defined(HAVE_DECLARED_TIMEZONE)
|
||||||
# include <time.h>
|
|
||||||
#else
|
|
||||||
# if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE)
|
|
||||||
extern time_t timezone;
|
extern time_t timezone;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define yylhs date_yylhs
|
#define yylhs date_yylhs
|
||||||
#define yylen date_yylen
|
#define yylen date_yylen
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* Defines and types for Windows 95/NT */
|
/* Defines and types for Windows 95/NT */
|
||||||
|
#define HAVE_DECLARED_TIMEZONE
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue