From 75183064b541ddbc948843ca48b46614a500a43b Mon Sep 17 00:00:00 2001 From: Pavlo Yatsukhnenko Date: Tue, 11 Oct 2016 22:29:18 +0300 Subject: WIP: php7 compatibility Wrap zend_register_internal_class_ex calls + redis-cluster GET_CONTEXT --- redis_cluster.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'redis_cluster.h') diff --git a/redis_cluster.h b/redis_cluster.h index 4a7facfd..f6be80ba 100644 --- a/redis_cluster.h +++ b/redis_cluster.h @@ -10,8 +10,13 @@ #define REDIS_CLUSTER_MOD (REDIS_CLUSTER_SLOTS-1) /* Get attached object context */ +#if (PHP_MAJOR_VERSION < 7) #define GET_CONTEXT() \ ((redisCluster*)zend_object_store_get_object(getThis() TSRMLS_CC)) +#else +#define GET_CONTEXT() \ + ((redisCluster *)((char *)getThis() - XtOffsetOf(redisCluster, std))) +#endif /* Command building/processing is identical for every command */ #define CLUSTER_BUILD_CMD(name, c, cmd, cmd_len, slot) \ -- cgit v1.2.3