zend.h breaks system headers on OSX in PHP 5.3

From: Date: Wed, 07 Nov 2007 04:43:01 +0000
Subject: zend.h breaks system headers on OSX in PHP 5.3
Groups: php.internals 
Request: Send a blank email to internals+get-33044@lists.php.net to get a copy of this message
The system headers on OSX use __attribute__((always_inline)) and zend.h defines always_inline to something else, breaking the build when the compiler tries to resolve that attribute name. A solution is to prefix the defines used in the engine with zend or ZEND or other similar namespacing token, which I thought was our standard practice, considering everything else in there has a prefix. If there have been other similar changes elsewhere, they should also be fixed --Wez. Index: zend.h =================================================================== RCS file: /repository/ZendEngine2/zend.h,v retrieving revision 1.293.2.11.2.9.2.9 diff -u -p -r1.293.2.11.2.9.2.9 zend.h --- zend.h 2 Nov 2007 19:40:37 -0000 1.293.2.11.2.9.2.9 +++ zend.h 7 Nov 2007 04:36:01 -0000 @@ -324,42 +324,42 @@ struct _zval_struct { #define Z_SET_ISREF_TO(z, isref) Z_SET_ISREF_TO_P(&(z), isref) #if defined(__GNUC__) -#define always_inline inline __attribute__((always_inline)) +#define zend_always_inline inline __attribute__((always_inline)) #elif defined(_MSC_VER) -#define always_inline __forceinline +#define zend_always_inline __forceinline #else -#define always_inline inline +#define zend_always_inline inline #endif -static always_inline zend_uint zval_refcount_p(zval* pz) { +static zend_always_inline zend_uint zval_refcount_p(zval* pz) { return pz->refcount__gc; } -static always_inline zend_uint zval_set_refcount_p(zval* pz, zend_uint rc) { +static zend_always_inline zend_uint zval_set_refcount_p(zval* pz, zend_uint rc) { return pz->refcount__gc = rc; } -static always_inline zend_uint zval_addref_p(zval* pz) { +static zend_always_inline zend_uint zval_addref_p(zval* pz) { return ++pz->refcount__gc; } -static always_inline zend_uint zval_delref_p(zval* pz) { +static zend_always_inline zend_uint zval_delref_p(zval* pz) { return --pz->refcount__gc; } -static always_inline zend_bool zval_isref_p(zval* pz) { +static zend_always_inline zend_bool zval_isref_p(zval* pz) { return pz->is_ref__gc; } -static always_inline zend_bool zval_set_isref_p(zval* pz) { +static zend_always_inline zend_bool zval_set_isref_p(zval* pz) { return pz->is_ref__gc = 1; } -static always_inline zend_bool zval_unset_isref_p(zval* pz) { +static zend_always_inline zend_bool zval_unset_isref_p(zval* pz) { return pz->is_ref__gc = 0; } -static always_inline zend_bool zval_set_isref_to_p(zval* pz, zend_bool isref) { +static zend_always_inline zend_bool zval_set_isref_to_p(zval* pz, zend_bool isref) { return pz->is_ref__gc = isref; }

« previous php.internals (#33044) next »