summaryrefslogtreecommitdiffstats
path: root/266.patch
blob: aa160b5f0cd3aa462556107c4bab4c127743e10e (plain)
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
48
49
50
51
52
53
54
55
56
57
From f9ab74b28ce6a0add3a24c57c7c7f9f5fa1dc9d7 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 27 Apr 2020 10:15:06 +0200
Subject: [PATCH] fix build with recent GCC

---
 build/php7/ice.c     | 9 ++++++---
 build/php7/php_ice.h | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/build/php7/ice.c b/build/php7/ice.c
index 304c911d..fb0d45e2 100644
--- a/build/php7/ice.c
+++ b/build/php7/ice.c
@@ -21,6 +21,9 @@
 #include "kernel/fcall.h"
 #include "kernel/memory.h"
 
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE()
+#endif
 
 
 zend_class_entry *ice_i18n_plural_pluralinterface_ce;
@@ -320,9 +323,6 @@ static void php_zephir_init_module_globals(zend_ice_globals *ice_globals TSRMLS_
 static PHP_RINIT_FUNCTION(ice)
 {
 	zend_ice_globals *ice_globals_ptr;
-#ifdef ZTS
-	tsrm_ls = ts_resource(0);
-#endif
 	ice_globals_ptr = ZEPHIR_VGLOBAL;
 
 	php_zephir_init_globals(ice_globals_ptr);
@@ -368,6 +368,9 @@ static PHP_MINFO_FUNCTION(ice)
 
 static PHP_GINIT_FUNCTION(ice)
 {
+#ifdef ZTS
+	ZEND_TSRMLS_CACHE_UPDATE();
+#endif
 	php_zephir_init_globals(ice_globals);
 	php_zephir_init_module_globals(ice_globals);
 }
diff --git a/build/php7/php_ice.h b/build/php7/php_ice.h
index ee20ead9..20906e49 100644
--- a/build/php7/php_ice.h
+++ b/build/php7/php_ice.h
@@ -53,7 +53,7 @@ ZEND_EXTERN_MODULE_GLOBALS(ice)
 #endif
 
 #ifdef ZTS
-	void ***tsrm_ls;
+	ZEND_TSRMLS_CACHE_EXTERN()
 	#define ZEPHIR_VGLOBAL ((zend_ice_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(ice_globals_id)])
 #else
 	#define ZEPHIR_VGLOBAL &(ice_globals)