aboutsummaryrefslogtreecommitdiff
path: root/php/ext/google/protobuf/protobuf.h
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2018-07-12 12:34:18 -0700
committerGitHub <noreply@github.com>2018-07-12 12:34:18 -0700
commit22503a01722939385a7584c3b65f1c43dc5b2ef8 (patch)
treed6e5dbe9f854052d729dfd29f28929068be531e0 /php/ext/google/protobuf/protobuf.h
parente529d162838f747362c123ec10e87ebe3970c677 (diff)
downloadprotobuf-22503a01722939385a7584c3b65f1c43dc5b2ef8.tar.gz
protobuf-22503a01722939385a7584c3b65f1c43dc5b2ef8.tar.bz2
protobuf-22503a01722939385a7584c3b65f1c43dc5b2ef8.zip
fix for API change in PHP 7.3 (#4898)
Diffstat (limited to 'php/ext/google/protobuf/protobuf.h')
-rw-r--r--php/ext/google/protobuf/protobuf.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h
index 20035ab7..6193b28d 100644
--- a/php/ext/google/protobuf/protobuf.h
+++ b/php/ext/google/protobuf/protobuf.h
@@ -46,6 +46,11 @@
// PHP7 Wrappers
// ----------------------------------------------------------------------------
+#if PHP_VERSION_ID < 70300
+#define GC_ADDREF(h) ++GC_REFCOUNT(h)
+#define GC_DELREF(h) --GC_REFCOUNT(h)
+#endif
+
#if PHP_MAJOR_VERSION < 7
#define php_proto_zend_literal const zend_literal*
@@ -496,7 +501,7 @@ static inline int php_proto_zend_hash_get_current_data_ex(HashTable* ht,
PHP_PROTO_HASHTABLE_VALUE WRAPPED_OBJ; \
WRAPPED_OBJ = OBJ_CLASS_ENTRY->create_object(OBJ_CLASS_ENTRY); \
OBJ = UNBOX_HASHTABLE_VALUE(OBJ_TYPE, WRAPPED_OBJ); \
- --GC_REFCOUNT(WRAPPED_OBJ);
+ GC_DELREF(WRAPPED_OBJ);
#define PHP_PROTO_CE_DECLARE zend_class_entry*
#define PHP_PROTO_CE_UNREF(ce) (ce)