File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,10 @@ typedef struct clusterFoldItem clusterFoldItem;
173173
174174/* RedisCluster implementation structure */ 
175175typedef  struct  redisCluster  {
176+ #if  (PHP_MAJOR_VERSION  <  7 )
177+     zend_object  std ;
178+ #endif 
179+ 
176180    /* Timeout and read timeout (for normal operations) */ 
177181    double  timeout ;
178182    double  read_timeout ;
@@ -242,8 +246,10 @@ typedef struct redisCluster {
242246    unsigned short      redir_slot ;
243247    unsigned short      redir_port ;
244248
249+ #if  (PHP_MAJOR_VERSION  >= 7 )
245250    /* Zend object handler */ 
246251    zend_object  std ;
252+ #endif 
247253} redisCluster ;
248254
249255/* RedisCluster response processing callback */ 
Original file line number Diff line number Diff line change @@ -342,7 +342,11 @@ create_cluster_context(zend_class_entry *class_type TSRMLS_DC) {
342342
343343/* Helper to retrieve the redisCluster object from the zend_object member */ 
344344static  redisCluster  * getClusterObject (zend_object  * object ) {
345+ #if  (PHP_MAJOR_VERSION  <  7 )
346+     return  (redisCluster * )object ;
347+ #else 
345348    return  (redisCluster * )((char * )(object ) -  XtOffsetOf (redisCluster , std ));
349+ #endif 
346350}
347351
348352/* Free redisCluster context */ 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments