facebook/hiphop-php — pull request #758 by tstarling (2013-05-09 03:01:30+00:00)
Title: 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.