diff options
-rw-r--r-- | redis.c | 8 | ||||
-rw-r--r-- | redis_cluster.h | 5 |
2 files changed, 13 insertions, 0 deletions
@@ -595,8 +595,12 @@ PHP_MINIT_FUNCTION(redis) INIT_CLASS_ENTRY(redis_exception_class_entry, "RedisException", NULL); redis_exception_ce = zend_register_internal_class_ex( &redis_exception_class_entry, +#if (PHP_MAJOR_VERSION < 7) redis_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC +#else + redis_get_exception_base(0) +#endif ); /* RedisClusterException class */ @@ -604,8 +608,12 @@ PHP_MINIT_FUNCTION(redis) "RedisClusterException", NULL); redis_cluster_exception_ce = zend_register_internal_class_ex( &redis_cluster_exception_class_entry, +#if (PHP_MAJOR_VERSION < 7) rediscluster_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC +#else + rediscluster_get_exception_base(0) +#endif ); le_redis_sock = zend_register_list_destructors_ex( 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) \ |