Skip to content

Commit 11102e2

Browse files
committed
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.
1 parent 633fb2d commit 11102e2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ext/date/config.w32

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tl_config.WriteLine("#include \"config.w32.h\"");
1212
tl_config.WriteLine("#include <php_stdint.h>");
1313
tl_config.WriteLine("#include \"win32/php_inttypes.h\"");
1414
tl_config.WriteLine("#define TIMELIB_OMIT_STDINT 1");
15+
tl_config.WriteLine("#define TIMELIB_FORCE_LONG32 1");
1516
tl_config.Close();
1617

1718
PHP_INSTALL_HEADERS("ext/date/", "php_date.h lib/timelib.h lib/timelib_structs.h lib/timelib_config.h");

ext/date/lib/timelib_structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ typedef unsigned __int64 uint64_t;
125125
#include <strings.h>
126126
#endif
127127

128-
#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
128+
#if (defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)) && !defined(TIMELIB_FORCE_LONG32)
129129
typedef int64_t timelib_long;
130130
typedef uint64_t timelib_ulong;
131131
# define TIMELIB_LONG_MAX INT64_MAX

0 commit comments

Comments
 (0)