diff options
author | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2017-10-05 15:27:18 +0300 |
---|---|---|
committer | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2017-10-05 15:27:18 +0300 |
commit | 0115666e59f1348d983872bd5488f52018a472c1 (patch) | |
tree | 5b5a8d0a1ef41685705c7652f98143efcdeb16a2 /redis_array.c | |
parent | 6d63d12066db759c3435c16253c93a99b11d5597 (diff) |
Add PHPREDIS_GET_OBJECT macros
Diffstat (limited to 'redis_array.c')
-rw-r--r-- | redis_array.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/redis_array.c b/redis_array.c index 52713063..b293253f 100644 --- a/redis_array.c +++ b/redis_array.c @@ -245,11 +245,7 @@ redis_array_get(zval *id TSRMLS_DC) redis_array_object *obj; if (Z_TYPE_P(id) == IS_OBJECT) { -#if (PHP_MAJOR_VERSION < 7) - obj = (redis_array_object *)zend_objects_get_address(id TSRMLS_CC); -#else - obj = (redis_array_object *)((char *)Z_OBJ_P(id) - XtOffsetOf(redis_array_object, std)); -#endif + obj = PHPREDIS_GET_OBJECT(redis_array_object, id); return obj->ra; } return NULL; @@ -368,11 +364,7 @@ PHP_METHOD(RedisArray, __construct) ra->auto_rehash = b_autorehash; ra->connect_timeout = d_connect_timeout; if(ra->prev) ra->prev->auto_rehash = b_autorehash; -#if (PHP_MAJOR_VERSION < 7) - obj = (redis_array_object *)zend_objects_get_address(getThis() TSRMLS_CC); -#else - obj = (redis_array_object *)((char *)Z_OBJ_P(getThis()) - XtOffsetOf(redis_array_object, std)); -#endif + obj = PHPREDIS_GET_OBJECT(redis_array_object, getThis()); obj->ra = ra; } } |