0002-fix-for-php-7.3.patch 1.3 KB

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