Skip to content

Commit f5fd58f

Browse files
committed
Better check for __builtin_constant_p() availability
1 parent 90976c9 commit f5fd58f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Zend/zend_alloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC Z
8484
#include "zend_alloc_sizes.h"
8585

8686
/* _emalloc() & _efree() specialization */
87-
#if !ZEND_DEBUG && !defined(_WIN32)
87+
#if !ZEND_DEBUG && defined(HAVE_BUILTIN_CONSTANT_P)
8888

8989
# define _ZEND_BIN_ALLOCATOR_DEF(_num, _size, _elements, _pages, x, y) \
9090
ZEND_API void* ZEND_FASTCALL _emalloc_ ## _size(void) ZEND_ATTRIBUTE_MALLOC;

Zend/zend_portability.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ char *alloca();
246246
# define HAVE_ATTRIBUTE_WEAK
247247
#endif
248248

249+
#if ZEND_GCC_VERSION >= 3001 || __has_builtin(__builtin_constant_p)
250+
# define HAVE_BUILTIN_CONSTANT_P
251+
#endif
252+
249253
#if ZEND_DEBUG
250254
# define zend_always_inline inline
251255
# define zend_never_inline

0 commit comments

Comments
 (0)