diff options
author | Andi Gutmans <andi@php.net> | 2001-04-19 17:51:23 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2001-04-19 17:51:23 +0000 |
commit | 02af513c0d136daab8bdb2f0296fb8afd3dcd315 (patch) | |
tree | ffb273fa024b3be5c178d4b7f216832f42d77b57 | |
parent | 06e6363985497b2d9407ff199eb5ccf6aacc17e9 (diff) | |
download | php-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.h | 8 |
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); |