Skip to content

Commit 0787cd6

Browse files
committed
first stone on using the unified globals accessor
1 parent 43cdfd9 commit 0787cd6

File tree

4 files changed

+5
-24
lines changed

4 files changed

+5
-24
lines changed

ext/date/php_date.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,7 @@ ZEND_BEGIN_MODULE_GLOBALS(date)
202202
int timezone_valid;
203203
ZEND_END_MODULE_GLOBALS(date)
204204

205-
#ifdef ZTS
206-
#define DATEG(v) ZEND_TSRMG(date_globals_id, zend_date_globals *, v)
207-
#else
208-
#define DATEG(v) (date_globals.v)
209-
#endif
205+
#define DATEG(v) ZEND_MODULE_GLOBALS_ACCESSOR(date, v)
210206

211207
/* Backwards compatibility wrapper */
212208
PHPAPI zend_long php_parse_date(char *string, zend_long *now);

ext/pcre/php_pcre.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,7 @@ ZEND_BEGIN_MODULE_GLOBALS(pcre)
8282
ZEND_END_MODULE_GLOBALS(pcre)
8383

8484
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(pcre);
85-
86-
#ifdef ZTS
87-
# define PCRE_G(v) ZEND_TSRMG(pcre_globals_id, zend_pcre_globals *, v)
88-
#else
89-
# define PCRE_G(v) (pcre_globals.v)
90-
#endif
85+
#define PCRE_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(pcre, v)
9186

9287
#else
9388

ext/spl/php_spl.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,8 @@ ZEND_BEGIN_MODULE_GLOBALS(spl)
6868
int autoload_running;
6969
ZEND_END_MODULE_GLOBALS(spl)
7070

71-
#ifdef ZTS
72-
# define SPL_G(v) ZEND_TSRMG(spl_globals_id, zend_spl_globals *, v)
73-
extern int spl_globals_id;
74-
#else
75-
# define SPL_G(v) (spl_globals.v)
76-
extern zend_spl_globals spl_globals;
77-
#endif
71+
ZEND_EXTERN_MODULE_GLOBALS(spl);
72+
#define SPL_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(spl, v)
7873

7974
PHP_FUNCTION(spl_classes);
8075
PHP_FUNCTION(class_parents);

ext/standard/browscap.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ ZEND_BEGIN_MODULE_GLOBALS(browscap)
4444
ZEND_END_MODULE_GLOBALS(browscap)
4545

4646
ZEND_DECLARE_MODULE_GLOBALS(browscap)
47-
48-
#ifdef ZTS
49-
#define BROWSCAP_G(v) ZEND_TSRMG(browscap_globals_id, zend_browscap_globals *, v)
50-
#else
51-
#define BROWSCAP_G(v) (browscap_globals.v)
52-
#endif
47+
#define BROWSCAP_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(browscap, v)
5348

5449
#define DEFAULT_SECTION_NAME "Default Browser Capability Settings"
5550

0 commit comments

Comments
 (0)