From: Anatol Belski Date: Mon, 15 Feb 2016 15:50:42 +0000 (+0100) Subject: Fix timelib compat with PHP5 X-Git-Tag: php-7.0.4RC1~5^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11102e26534d5a8ff91a50917cca00c51435ffb2;p=php 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. --- 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 "); 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 #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