Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2016-10-11 22:29:18 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2016-10-11 22:50:30 +0300
commit75183064b541ddbc948843ca48b46614a500a43b (patch)
tree0ee5c61ecb6dd233708489800ee5c95c72e9c5a6 /redis_cluster.h
parent155ae3633c54efb14d91b2d5b3376804681667c3 (diff)
WIP: php7 compatibility
Wrap zend_register_internal_class_ex calls + redis-cluster GET_CONTEXT
Diffstat (limited to 'redis_cluster.h')
-rw-r--r--redis_cluster.h5
1 files changed, 5 insertions, 0 deletions
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) \