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.
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");
#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