]> granicus.if.org Git - php/commitdiff
Declare timezone only, if the system fails to do so.
authorSascha Schumann <sas@php.net>
Sat, 1 Jan 2000 02:22:01 +0000 (02:22 +0000)
committerSascha Schumann <sas@php.net>
Sat, 1 Jan 2000 02:22:01 +0000 (02:22 +0000)
acconfig.h.in
acinclude.m4
configure.in
ext/standard/datetime.c
ext/standard/parsedate.y
main/win95nt.h

index 1a85f3acbffd2685525d3621426ecf793717609e..ab1e69378b90a49f56b5aded50445ec5a1c64780 100644 (file)
@@ -1,7 +1,5 @@
 /* This is the default configuration file to read -*- C -*- */
 
-#undef socklen_t
-
 /* these are defined by automake */
 #undef PACKAGE
 #undef VERSION
index b45ca77debf869a1f5fec304bf0a0699357c8099..0fe1571c497345dc282d97da3164685ea8df98fb 100644 (file)
@@ -484,3 +484,22 @@ AC_DEFUN(PHP_OUTPUT,[
   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
+])
index 0c8f6ed22698364b9a75a552fbcf59357bd89824..fee52bf8b8d3651000d849b66b7963df43e16460 100644 (file)
@@ -335,6 +335,7 @@ AC_REPLACE_FUNCS(strlcat strlcpy getopt)
 AC_FUNC_UTIME_NULL
 AC_FUNC_ALLOCA
 AC_BROKEN_SPRINTF
+PHP_DECLARED_TIMEZONE
 
 dnl AIX keeps in_addr_t in /usr/include/netinet/in.h
 dnl AC_MSG_CHECKING(for in_addr_t)
index d2fb2a40a05629c9f426fa6c1d9eb2821a9d575a..650fc82b4d4aa342fca7381b72a1e0f970258a0b 100644 (file)
@@ -53,7 +53,7 @@ char *day_short_names[] =
        "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;
 #endif
 
index 393207da09658344468a705806f09c4741569c41..28aabf5e4fb45657fdbe9ff1ba269da3dc939661 100644 (file)
 #include <alloca.h>
 #endif
 
-#if WIN32||WINNT
-#      include <time.h>
-#else
-#      if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE)
+#if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE) && !defined(HAVE_DECLARED_TIMEZONE)
 extern time_t timezone;
-#      endif
 #endif
 
-
 #define yylhs          date_yylhs
 #define yylen          date_yylen
 #define yydefred       date_yydefred
index 0808a84638ae2e5874e573490c21ec233fe3f55d..b481d70f61963b8ee2daccc1952e81516db21a55 100644 (file)
@@ -1,4 +1,5 @@
 /* Defines and types for Windows 95/NT */
+#define HAVE_DECLARED_TIMEZONE
 #define WIN32_LEAN_AND_MEAN
 #include <io.h>
 #include <malloc.h>