1From e0db82c3286da81fa8945894dd10125a528299e4 Mon Sep 17 00:00:00 2001 2From: =?UTF-8?q?Gr=C3=A9gory=20PLANCHAT?= 3 <gplanchat@users.noreply.github.com> 4Date: Wed, 8 Jul 2020 10:09:38 +0200 5Subject: [PATCH] Fix for PHP 7.3 (#215) 6 7Co-authored-by: Remi Collet <remi@remirepo.net> 8Signed-off-by: Adam Duskett <aduskett@gmail.com> 9--- 10 zmq.c | 8 ++++++++ 11 1 file changed, 8 insertions(+) 12 13diff --git a/zmq.c b/zmq.c 14index 66196ea..879704f 100644 15--- a/zmq.c 16+++ b/zmq.c 17@@ -235,7 +235,11 @@ php_zmq_context *php_zmq_context_get(zend_long io_threads, zend_bool is_persiste 18 le.type = php_zmq_context_list_entry(); 19 le.ptr = context; 20 21+#if PHP_VERSION_ID < 70300 22 GC_REFCOUNT(&le) = 1; 23+#else 24+ GC_SET_REFCOUNT(&le, 1); 25+#endif 26 27 /* plist_key is not a persistent allocated key, thus we use str_update here */ 28 if (zend_hash_str_update_mem(&EG(persistent_list), plist_key->val, plist_key->len, &le, sizeof(le)) == NULL) { 29@@ -535,7 +539,11 @@ void php_zmq_socket_store(php_zmq_socket *zmq_sock_p, zend_long type, zend_strin 30 le.type = php_zmq_socket_list_entry(); 31 le.ptr = zmq_sock_p; 32 33+#if PHP_VERSION_ID < 70300 34 GC_REFCOUNT(&le) = 1; 35+#else 36+ GC_SET_REFCOUNT(&le, 1); 37+#endif 38 39 plist_key = php_zmq_socket_plist_key(type, persistent_id, use_shared_ctx); 40 41-- 422.31.1 43 44