]> granicus.if.org Git - php/commitdiff
fix build with older gccs: label attributes are only available with gcc 5+
authorNuno Lopes <nlopess@php.net>
Mon, 4 Dec 2017 20:12:20 +0000 (15:12 -0500)
committerNuno Lopes <nlopess@php.net>
Mon, 4 Dec 2017 20:12:20 +0000 (15:12 -0500)
Zend/zend_portability.h

index 2003734f0cd764cbd9ff5b9a091988c18e61b217..05735507191ad7e74fd208ba90c4821b97d1e8ed 100644 (file)
@@ -219,18 +219,22 @@ char *alloca();
 
 #if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003
 # define ZEND_ATTRIBUTE_UNUSED __attribute__((unused))
-# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused));
-# define ZEND_ATTRIBUTE_COLD_LABEL __attribute__((cold));
-# define ZEND_ATTRIBUTE_HOT_LABEL __attribute__((hot));
 # define ZEND_COLD __attribute__((cold))
 # define ZEND_HOT __attribute__((hot))
 #else
 # define ZEND_ATTRIBUTE_UNUSED
+# define ZEND_COLD
+# define ZEND_HOT
+#endif
+
+#if defined(__GNUC__) && ZEND_GCC_VERSION >= 5000
+# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused));
+# define ZEND_ATTRIBUTE_COLD_LABEL __attribute__((cold));
+# define ZEND_ATTRIBUTE_HOT_LABEL __attribute__((hot));
+#else
 # define ZEND_ATTRIBUTE_UNUSED_LABEL
 # define ZEND_ATTRIBUTE_COLD_LABEL
 # define ZEND_ATTRIBUTE_HOT_LABEL
-# define ZEND_COLD
-# define ZEND_HOT
 #endif
 
 #if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)