summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-02-15 16:50:42 +0100
committerAnatol Belski <ab@php.net>2016-02-15 16:50:42 +0100
commit11102e26534d5a8ff91a50917cca00c51435ffb2 (patch)
treea316c7074ca45ff8e7665570dcb2371fd7549bac
parent633fb2d0e856243ed459cfe67a93c31352045c08 (diff)
downloadphp-git-11102e26534d5a8ff91a50917cca00c51435ffb2.tar.gz
Fix timelib compat with PHP5
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.
-rwxr-xr-xext/date/config.w321
-rw-r--r--ext/date/lib/timelib_structs.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/ext/date/config.w32 b/ext/date/config.w32
index 5f5f08781d..4e7c4bbe80 100755
--- a/ext/date/config.w32
+++ b/ext/date/config.w32
@@ -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");
diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h
index d38175753a..91fcac9119 100644
--- a/ext/date/lib/timelib_structs.h
+++ b/ext/date/lib/timelib_structs.h
@@ -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