@@ -272,7 +272,7 @@ char *alloca();
272272# define ZEND_ATTRIBUTE_NODISCARD
273273#endif
274274
275- #if ZEND_GCC_VERSION >= 3000
275+ #if ZEND_GCC_VERSION >= 3000 || __has_attribute(const)
276276# define ZEND_ATTRIBUTE_CONST __attribute__ ((const ))
277277#else
278278# define ZEND_ATTRIBUTE_CONST
@@ -314,7 +314,7 @@ char *alloca();
314314# define ZEND_ATTRIBUTE_NONNULL_ARGS (...)
315315#endif
316316
317- #if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003
317+ #if ( defined(__GNUC__) && ZEND_GCC_VERSION >= 4003) || __has_attribute(cold)
318318# define ZEND_COLD __attribute__ ((cold))
319319# ifdef __OPTIMIZE__
320320# define ZEND_OPT_SIZE __attribute__ ((optimize(" Os" )))
@@ -329,7 +329,7 @@ char *alloca();
329329# define ZEND_OPT_SPEED
330330#endif
331331
332- #if defined(__GNUC__) && ZEND_GCC_VERSION >= 5000
332+ #if ( defined(__GNUC__) && ZEND_GCC_VERSION >= 5000) || (__has_attribute(unused) && __has_attribute(cold))
333333# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__ ((unused));
334334# define ZEND_ATTRIBUTE_COLD_LABEL __attribute__ ((cold));
335335#else
@@ -653,7 +653,7 @@ extern "C++" {
653653#endif
654654
655655/* Do not use for conditional declaration of API functions! */
656- #if defined(ZEND_INTRIN_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000))
656+ #if defined(ZEND_INTRIN_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || defined(__clang__) || (ZEND_GCC_VERSION >= 9000))
657657/* __builtin_cpu_supports has pclmul from gcc9 */
658658# define ZEND_INTRIN_PCLMUL_FUNC_PROTO 1
659659#elif defined(ZEND_INTRIN_PCLMUL_RESOLVER)
@@ -679,7 +679,7 @@ extern "C++" {
679679#endif
680680
681681/* Do not use for conditional declaration of API functions! */
682- #if defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000))
682+ #if defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || defined(__clang__) || (ZEND_GCC_VERSION >= 9000))
683683/* __builtin_cpu_supports has pclmul from gcc9 */
684684# define ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PROTO 1
685685#elif defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER)
0 commit comments