Add missing macros to timelib_config.h

The absence of HAVE_LIMITS_H caused timelib_structs.h to define LONG_MIN
and LONG_MAX to be 32-bit values, which caused timelib_date_to_int() to
give an error for a date after 2038, which caused the current time to be
returned for e.g. date_create('28 July 2038')->format('r').

The issue was detected by MediaWiki unit tests, and this fix was tested
by the same method.

While I was at it, I also added HAVE_LOCALE_H, which was checked for in
CMakeLists.txt but not used, and I fixed the definition of SIZEOF_INT
(#cmakedefine doesn't work that way). I arranged the macros in
timelib_config.h.cmake in the same order as they are in CMakeLists.txt.
Esse commit está contido em:
Tim Starling
2013-05-09 12:41:14 +10:00
commit 9832e88a27
2 arquivos alterados com 5 adições e 2 exclusões
+1
Ver Arquivo
@@ -29,6 +29,7 @@ TIME_CHECK_INCLUDE("limits.h")
CHECK_TYPE_SIZE("int32_t" HAVE_INT32_T)
CHECK_TYPE_SIZE("uint32_t" HAVE_UINT32_T)
CHECK_TYPE_SIZE("int" SIZEOF_INT)
CHECK_FUNCTION_EXISTS("strtoll" HAVE_STRTOLL)
CHECK_FUNCTION_EXISTS("atoll" HAVE_ATOLL)
+4 -2
Ver Arquivo
@@ -1,10 +1,12 @@
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDLIB_H 1
#cmakedefine HAVE_STRING_H 1
#cmakedefine HAVE_STDLIB_H 1
#cmakedefine HAVE_LOCALE_H 1
#cmakedefine HAVE_LIMITS_H 1
#cmakedefine HAVE_STRTOLL 1
#cmakedefine HAVE_ATOLL 1
#cmakedefine HAVE_INT32_T 1
#cmakedefine HAVE_UINT32_T 1
#cmakedefine SIZEOF_INT 4
#define SIZEOF_INT @SIZEOF_INT@