com php-src: first stone on using the unified globals accessor: ext/date/php_date.h ext/pcre/php_pcre.h ext/spl/php _spl.h ext/standard/browscap.c
| From: | Anatol Belski | Date: | Wed, 29 Jul 2015 08:36:30 +0000 |
| Subject: | com php-src: first stone on using the unified globals accessor: ext/date/php_date.h ext/pcre/php_pcre.h ext/spl/php _spl.h ext/standard/browscap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88218@lists.php.net to get a copy of this message | ||
Commit: 0787cd60ed3d0c8c8c8ff7e49b9bb3587bf33b64
Author: Anatol Belski <ab@php.net> Wed, 29 Jul 2015 10:35:57 +0200
Parents: 43cdfd9a82f99ddfc21c3b11bdebc565a4349634
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0787cd60ed3d0c8c8c8ff7e49b9bb3587bf33b64
Log:
first stone on using the unified globals accessor
Changed paths:
M ext/date/php_date.h
M ext/pcre/php_pcre.h
M ext/spl/php_spl.h
M ext/standard/browscap.c
Diff:
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index a2f5261..116ea32 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 fb155c4..d3fe0b5 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 015ada4..bcee32e 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 86d1cf5..8f79ae7 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"