Skip to content

Commit f550839

Browse files
committed
fix build with older gccs: label attributes are only available with gcc 5+
1 parent 525ab41 commit f550839

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Zend/zend_portability.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,22 @@ char *alloca();
219219

220220
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003
221221
# define ZEND_ATTRIBUTE_UNUSED __attribute__((unused))
222-
# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused));
223-
# define ZEND_ATTRIBUTE_COLD_LABEL __attribute__((cold));
224-
# define ZEND_ATTRIBUTE_HOT_LABEL __attribute__((hot));
225222
# define ZEND_COLD __attribute__((cold))
226223
# define ZEND_HOT __attribute__((hot))
227224
#else
228225
# define ZEND_ATTRIBUTE_UNUSED
226+
# define ZEND_COLD
227+
# define ZEND_HOT
228+
#endif
229+
230+
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 5000
231+
# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused));
232+
# define ZEND_ATTRIBUTE_COLD_LABEL __attribute__((cold));
233+
# define ZEND_ATTRIBUTE_HOT_LABEL __attribute__((hot));
234+
#else
229235
# define ZEND_ATTRIBUTE_UNUSED_LABEL
230236
# define ZEND_ATTRIBUTE_COLD_LABEL
231237
# define ZEND_ATTRIBUTE_HOT_LABEL
232-
# define ZEND_COLD
233-
# define ZEND_HOT
234238
#endif
235239

236240
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)

0 commit comments

Comments
 (0)