1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
From fc685d1cb58746a8865fc4b86a38f90219de90ed Mon Sep 17 00:00:00 2001
From: Bob Weinand <bobwei9@hotmail.com>
Date: Wed, 28 Feb 2018 02:50:51 +0100
Subject: [PATCH] Fix build for newest php-src master
---
php_uv.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/php_uv.c b/php_uv.c
index 12052b7..b150fc4 100644
--- a/php_uv.c
+++ b/php_uv.c
@@ -50,7 +50,7 @@ ZEND_DECLARE_MODULE_GLOBALS(uv);
#if PHP_VERSION_ID < 70100
#define uv_zend_wrong_parameter_class_error(throw, ...) zend_wrong_paramer_class_error(__VA_ARGS__)
-#elif PHP_VERSION_ID < 70200
+#elif PHP_VERSION_ID < 70200 || PHP_VERSION_ID >= 70300
#define uv_zend_wrong_parameter_class_error(throw, ...) zend_wrong_parameter_class_error(__VA_ARGS__)
#else
#define uv_zend_wrong_parameter_class_error(...) zend_wrong_parameter_class_error(__VA_ARGS__)
@@ -230,7 +230,11 @@ static int uv_parse_arg_object(zval *arg, zval **dest, int check_null, zend_clas
ZVAL_UNDEF(&uv->fs_fd_alt); \
}
-#define PHP_UV_SKIP_DTOR(uv) do { GC_FLAGS(&uv->std) |= IS_OBJ_DESTRUCTOR_CALLED; } while (0)
+#if PHP_VERSION_ID < 70300
+ #define PHP_UV_SKIP_DTOR(uv) do { GC_FLAGS(&uv->std) |= IS_OBJ_DESTRUCTOR_CALLED; } while (0)
+#else
+ #define PHP_UV_SKIP_DTOR(uv) do { GC_ADD_FLAGS(&uv->std, IS_OBJ_DESTRUCTOR_CALLED); } while (0)
+#endif
#define PHP_UV_IS_DTORED(uv) (GC_FLAGS(&uv->std) & IS_OBJ_DESTRUCTOR_CALLED)
#define PHP_UV_SOCKADDR_IPV4_INIT(sockaddr) PHP_UV_INIT_GENERIC(sockaddr, php_uv_sockaddr_t, uv_sockaddr_ipv4_ce);
@@ -3548,7 +3552,11 @@ PHP_FUNCTION(uv_loop_delete)
ZEND_PARSE_PARAMETERS_END();
if (loop != UV_G(default_loop)) {
+#if PHP_VERSION_ID < 70300
GC_FLAGS(&loop->std) |= IS_OBJ_DESTRUCTOR_CALLED;
+#else
+ GC_ADD_FLAGS(&loop->std, IS_OBJ_DESTRUCTOR_CALLED);
+#endif
destruct_uv_loop(&loop->std);
}
}
|