From 29a8981c81a7403070305ab4631c2fa9e858a082 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Thu, 20 Aug 2015 11:09:43 -0700 Subject: Enable definitions of stdint.h limits/constants used by Zend/zend_long.h Define __STDC_LIMITS_MACROS and __STDC_CONSTANT_MACROS prior to including stdint.h for the first time so that it defines the INT64_MAX / INT64_C / etc... macros we use elsewhere when building for C++ (C already gets these). --- main/php_stdint.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'main/php_stdint.h') diff --git a/main/php_stdint.h b/main/php_stdint.h index d04b67e175..29a81f20bc 100644 --- a/main/php_stdint.h +++ b/main/php_stdint.h @@ -42,6 +42,21 @@ #include "php_config.h" +#if HAVE_STDINT_H && defined(__cplusplus) + /* C99 requires these for C++ to get the definitions + * of INT64_MAX and other macros used by Zend/zend_long.h + * C11 drops this requirement, so these effectively + * just backport that piece of behavior. + * + * These defines are placed here instead of + * with the include below, because sys/types + * and inttypes may include stdint themselves. + * And these definitions MUST come first. + */ +# define __STDC_LIMIT_MACROS +# define __STDC_CONSTANT_MACROS +#endif + #if HAVE_SYS_TYPES_H # include #endif -- cgit v1.2.1