]> granicus.if.org Git - php/commitdiff
Fix timelib compat with PHP5
authorAnatol Belski <ab@php.net>
Mon, 15 Feb 2016 15:50:42 +0000 (16:50 +0100)
committerAnatol Belski <ab@php.net>
Mon, 15 Feb 2016 15:50:42 +0000 (16:50 +0100)
Windows builds in PHP5 are always using long which is 32-bit even
in 64-bit build. Thus in PHP5, timelib_long and the company have
to always evaluate to a 32-bit.

ext/date/config.w32
ext/date/lib/timelib_structs.h

index 5f5f08781d9fa5bea8fc521b89ffd5c7ab105b29..4e7c4bbe8074de7de3a017a16059ae0f7048d1f5 100755 (executable)
@@ -12,6 +12,7 @@ tl_config.WriteLine("#include \"config.w32.h\"");
 tl_config.WriteLine("#include <php_stdint.h>");
 tl_config.WriteLine("#include \"win32/php_inttypes.h\"");
 tl_config.WriteLine("#define TIMELIB_OMIT_STDINT 1");
+tl_config.WriteLine("#define TIMELIB_FORCE_LONG32 1");
 tl_config.Close();
 
 PHP_INSTALL_HEADERS("ext/date/", "php_date.h lib/timelib.h lib/timelib_structs.h lib/timelib_config.h");
index d38175753a46741f11a6e8c051849addca751797..91fcac9119c78ce364aed198c890b731e95e22d5 100644 (file)
@@ -125,7 +125,7 @@ typedef unsigned __int64  uint64_t;
 #include <strings.h>
 #endif
 
-#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
+#if (defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)) && !defined(TIMELIB_FORCE_LONG32)
 typedef int64_t timelib_long;
 typedef uint64_t timelib_ulong;
 # define TIMELIB_LONG_MAX INT64_MAX