com php-src: Make ATTRIBUTE_UNUSED more portable: Zen d/zend_portability.h

From: Date: Wed, 12 Jun 2019 12:29:23 +0000
Subject: com php-src: Make ATTRIBUTE_UNUSED more portable: Zen d/zend_portability.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106733@lists.php.net to get a copy of this message
Commit: 8f63e7e324c84319919f0f87eaa2505c5c4f512d Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 12 Jun 2019 14:29:23 +0200 Parents: cc89d260968746f1048029d711f113d2a9688a13 Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8f63e7e324c84319919f0f87eaa2505c5c4f512d Log: Make ATTRIBUTE_UNUSED more portable Changed paths: M Zend/zend_portability.h Diff: diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 009be97..aae08a4 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -217,8 +217,13 @@ char *alloca(); # define ZEND_ATTRIBUTE_DEPRECATED #endif -#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003 +#if ZEND_GCC_VERSION >= 4003 || __has_attribute(unused) # define ZEND_ATTRIBUTE_UNUSED __attribute__((unused)) +#else +# define ZEND_ATTRIBUTE_UNUSED +#endif + +#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003 # define ZEND_COLD __attribute__((cold)) # define ZEND_HOT __attribute__((hot)) # ifdef __OPTIMIZE__ @@ -229,7 +234,6 @@ char *alloca(); # define ZEND_OPT_SPEED # endif #else -# define ZEND_ATTRIBUTE_UNUSED # define ZEND_COLD # define ZEND_HOT # define ZEND_OPT_SIZE

« previous php.cvs (#106733) next »