summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-07-29 10:35:57 +0200
committerAnatol Belski <ab@php.net>2015-07-29 10:36:30 +0200
commit0787cd60ed3d0c8c8c8ff7e49b9bb3587bf33b64 (patch)
tree77fd146f85e4847ad64421f646dc7d98000ce97e
parent43cdfd9a82f99ddfc21c3b11bdebc565a4349634 (diff)
downloadphp-git-0787cd60ed3d0c8c8c8ff7e49b9bb3587bf33b64.tar.gz
first stone on using the unified globals accessor
-rw-r--r--ext/date/php_date.h6
-rw-r--r--ext/pcre/php_pcre.h7
-rw-r--r--ext/spl/php_spl.h9
-rw-r--r--ext/standard/browscap.c7
4 files changed, 5 insertions, 24 deletions
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index a2f5261ee6..116ea328e0 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -202,11 +202,7 @@ ZEND_BEGIN_MODULE_GLOBALS(date)
int timezone_valid;
ZEND_END_MODULE_GLOBALS(date)
-#ifdef ZTS
-#define DATEG(v) ZEND_TSRMG(date_globals_id, zend_date_globals *, v)
-#else
-#define DATEG(v) (date_globals.v)
-#endif
+#define DATEG(v) ZEND_MODULE_GLOBALS_ACCESSOR(date, v)
/* Backwards compatibility wrapper */
PHPAPI zend_long php_parse_date(char *string, zend_long *now);
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index fb155c467e..d3fe0b5d10 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -82,12 +82,7 @@ ZEND_BEGIN_MODULE_GLOBALS(pcre)
ZEND_END_MODULE_GLOBALS(pcre)
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(pcre);
-
-#ifdef ZTS
-# define PCRE_G(v) ZEND_TSRMG(pcre_globals_id, zend_pcre_globals *, v)
-#else
-# define PCRE_G(v) (pcre_globals.v)
-#endif
+#define PCRE_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(pcre, v)
#else
diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h
index 015ada4ac2..bcee32ea8b 100644
--- a/ext/spl/php_spl.h
+++ b/ext/spl/php_spl.h
@@ -68,13 +68,8 @@ ZEND_BEGIN_MODULE_GLOBALS(spl)
int autoload_running;
ZEND_END_MODULE_GLOBALS(spl)
-#ifdef ZTS
-# define SPL_G(v) ZEND_TSRMG(spl_globals_id, zend_spl_globals *, v)
-extern int spl_globals_id;
-#else
-# define SPL_G(v) (spl_globals.v)
-extern zend_spl_globals spl_globals;
-#endif
+ZEND_EXTERN_MODULE_GLOBALS(spl);
+#define SPL_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(spl, v)
PHP_FUNCTION(spl_classes);
PHP_FUNCTION(class_parents);
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 86d1cf5835..8f79ae714d 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -44,12 +44,7 @@ ZEND_BEGIN_MODULE_GLOBALS(browscap)
ZEND_END_MODULE_GLOBALS(browscap)
ZEND_DECLARE_MODULE_GLOBALS(browscap)
-
-#ifdef ZTS
-#define BROWSCAP_G(v) ZEND_TSRMG(browscap_globals_id, zend_browscap_globals *, v)
-#else
-#define BROWSCAP_G(v) (browscap_globals.v)
-#endif
+#define BROWSCAP_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(browscap, v)
#define DEFAULT_SECTION_NAME "Default Browser Capability Settings"