From: Dmitry Stogov Date: Thu, 25 Jun 2015 09:02:28 +0000 (+0300) Subject: Better check for __builtin_constant_p() availability X-Git-Tag: php-7.0.0beta1~12^2~49^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5fd58f737eb988fdd484effe0f05d5b6e9af64e;p=php Better check for __builtin_constant_p() availability --- diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index f76494e0d4..6c12b4247d 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -84,7 +84,7 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC Z #include "zend_alloc_sizes.h" /* _emalloc() & _efree() specialization */ -#if !ZEND_DEBUG && !defined(_WIN32) +#if !ZEND_DEBUG && defined(HAVE_BUILTIN_CONSTANT_P) # define _ZEND_BIN_ALLOCATOR_DEF(_num, _size, _elements, _pages, x, y) \ ZEND_API void* ZEND_FASTCALL _emalloc_ ## _size(void) ZEND_ATTRIBUTE_MALLOC; diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 57080ca7b7..8c6989d030 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -246,6 +246,10 @@ char *alloca(); # define HAVE_ATTRIBUTE_WEAK #endif +#if ZEND_GCC_VERSION >= 3001 || __has_builtin(__builtin_constant_p) +# define HAVE_BUILTIN_CONSTANT_P +#endif + #if ZEND_DEBUG # define zend_always_inline inline # define zend_never_inline