com php-src: Fix timelib compat with PHP5: ext/date/config.w32 ext/date/lib/timelib_structs.h
| From: | Anatol Belski | Date: | Mon, 15 Feb 2016 15:50:42 +0000 |
| Subject: | com php-src: Fix timelib compat with PHP5: ext/date/config.w32 ext/date/lib/timelib_structs.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91059@lists.php.net to get a copy of this message | ||
Commit: 11102e26534d5a8ff91a50917cca00c51435ffb2
Author: Anatol Belski <ab@php.net> Mon, 15 Feb 2016 16:50:42 +0100
Parents: 633fb2d0e856243ed459cfe67a93c31352045c08
Branches: PHP-5.6 PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=11102e26534d5a8ff91a50917cca00c51435ffb2
Log:
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.
Changed paths:
M ext/date/config.w32
M ext/date/lib/timelib_structs.h
Diff:
diff --git a/ext/date/config.w32 b/ext/date/config.w32
index 5f5f087..4e7c4bb 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 d381757..91fcac9 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