Permalink
Browse files

- 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.
  • Loading branch information...
1 parent 06e6363 commit 02af513c0d136daab8bdb2f0296fb8afd3dcd315 @andigutmans andigutmans committed Apr 19, 2001
Showing with 6 additions and 2 deletions.
  1. +6 −2 Zend/zend_API.h
View
@@ -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);

0 comments on commit 02af513

Please sign in to comment.