Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 02af513c0d136daab8bdb2f0296fb8afd3dcd315 1 parent 06e6363
@andigutmans andigutmans authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 Zend/zend_API.h
View
8 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);
Please sign in to comment.
Something went wrong with that request. Please try again.