@@ -12,6 +12,10 @@ extern zend_module_entry extname_module_entry;
12
12
#define PHP_EXTNAME_API
13
13
#endif
14
14
15
+ #ifdef ZTS
16
+ #include "TSRM.h"
17
+ #endif
18
+
15
19
PHP_MINIT_FUNCTION (extname );
16
20
PHP_MSHUTDOWN_FUNCTION (extname );
17
21
PHP_RINIT_FUNCTION (extname );
@@ -31,15 +35,18 @@ ZEND_BEGIN_MODULE_GLOBALS(extname)
31
35
ZEND_END_MODULE_GLOBALS(extname)
32
36
*/
33
37
34
- /* In every function that needs to use variables in php_extname_globals,
35
- do call EXTNAME_LS_FETCH(); after declaring other variables used by
36
- that function, and always refer to them as EXTNAME_G(variable).
37
- You are encouraged to rename these macros something shorter, see
38
+ /* In every utility function you add that needs to use variables
39
+ in php_extname_globals, call TSRM_FETCH(); after declaring other
40
+ variables used by that function, or better yet, pass in TSRMG_CC
41
+ after the last function argument and declare your utility function
42
+ with TSRMG_DC after the last declared argument. Always refer to
43
+ the globals in your function as EXTNAME_G(variable). You are
44
+ encouraged to rename these macros something shorter, see
38
45
examples in any other php module directory.
39
46
*/
40
47
41
48
#ifdef ZTS
42
- #define EXTNAME_G (v ) TSRMG(extname_globals_id, zend_##extname_globals *, v)
49
+ #define EXTNAME_G (v ) TSRMG(extname_globals_id, zend_extname_globals *, v)
43
50
#else
44
51
#define EXTNAME_G (v ) (extname_globals.v)
45
52
#endif
0 commit comments