summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2001-04-19 17:51:23 +0000
committerAndi Gutmans <andi@php.net>2001-04-19 17:51:23 +0000
commit02af513c0d136daab8bdb2f0296fb8afd3dcd315 (patch)
treeffb273fa024b3be5c178d4b7f216832f42d77b57
parent06e6363985497b2d9407ff199eb5ccf6aacc17e9 (diff)
downloadphp-git-02af513c0d136daab8bdb2f0296fb8afd3dcd315.tar.gz
- Patch from Jason Greene.
- Make it easier to write PHP function definitions in more than just one .c file while accessing the same module globals.
-rw-r--r--Zend/zend_API.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 2ad161ea6b..38717a4577 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -63,14 +63,18 @@
#ifdef ZTS
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
- static ts_rsrc_id module_name##_globals_id;
+ ts_rsrc_id module_name##_globals_id;
+#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \
+ extern ts_rsrc_id module_name##_globals_id;
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
module_name##_globals_id = ts_allocate_id(sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
#else
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
- static zend_##module_name##_globals module_name##_globals;
+ zend_##module_name##_globals module_name##_globals;
+#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \
+ extern zend_##module_name##_globals module_name##_globals;
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
globals_ctor(&module_name##_globals);