From fffe8d39f810d147c6db65f90ae4f71f4e0f0116 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Tue, 12 Dec 2017 17:47:04 -0800 Subject: Call php method via function name instead of calling directly. This changes the linking error if php extension is not statically linked to a runtime error. In this way, users who don't need Timestamp can still use protobuf even if date extension is not statically linked in php. --- php/ext/google/protobuf/protobuf.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'php/ext/google/protobuf/protobuf.h') diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index f299b415..6ab0f134 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -182,6 +182,8 @@ #define CACHED_TO_ZVAL_PTR(VALUE) (VALUE) #define CACHED_PTR_TO_ZVAL_PTR(VALUE) (*VALUE) #define ZVAL_PTR_TO_CACHED_PTR(VALUE) (&VALUE) +#define ZVAL_PTR_TO_CACHED_VALUE(VALUE) (VALUE) +#define ZVAL_TO_CACHED_VALUE(VALUE) (&VALUE) #define CREATE_OBJ_ON_ALLOCATED_ZVAL_PTR(zval_ptr, class_type) \ ZVAL_OBJ(zval_ptr, class_type->create_object(class_type TSRMLS_CC)); @@ -452,6 +454,8 @@ static inline int php_proto_zend_hash_get_current_data_ex(HashTable* ht, #define CACHED_TO_ZVAL_PTR(VALUE) (&VALUE) #define CACHED_PTR_TO_ZVAL_PTR(VALUE) (VALUE) #define ZVAL_PTR_TO_CACHED_PTR(VALUE) (VALUE) +#define ZVAL_PTR_TO_CACHED_VALUE(VALUE) (*VALUE) +#define ZVAL_TO_CACHED_VALUE(VALUE) (VALUE) #define CREATE_OBJ_ON_ALLOCATED_ZVAL_PTR(zval_ptr, class_type) \ ZVAL_OBJ(zval_ptr, class_type->create_object(class_type)); -- cgit v1.2.3