diff options
| author | Marcus Boerger <helly@php.net> | 2003-04-19 15:01:22 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-04-19 15:01:22 +0000 |
| commit | b99a491e33368e7077ff2ca07f2f6bdc615554a3 (patch) | |
| tree | fb27e9cb5da532ad47521219a3895a0cb42ce951 | |
| parent | 7ca29424c46f8a003dd03cc55d61168b7c586f75 (diff) | |
| download | php-git-b99a491e33368e7077ff2ca07f2f6bdc615554a3.tar.gz | |
Update to new macros
| -rw-r--r-- | ext/standard/assert.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/ext/standard/assert.c b/ext/standard/assert.c index aea67a04cc..3f4e5c396a 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -24,20 +24,20 @@ #include "php_assert.h" #include "php_ini.h" -typedef struct { +ZEND_BEGIN_MODULE_GLOBALS(assert) long active; long bail; long warning; long quiet_eval; zval *callback; -} php_assert_globals; +ZEND_END_MODULE_GLOBALS(assert) + +ZEND_DECLARE_MODULE_GLOBALS(assert) #ifdef ZTS -#define ASSERTG(v) TSRMG(assert_globals_id, php_assert_globals *, v) -int assert_globals_id; +#define ASSERTG(v) TSRMG(assert_globals_id, zend_assert_globals *, v) #else #define ASSERTG(v) (assert_globals.v) -php_assert_globals assert_globals; #endif #define SAFE_STRING(s) ((s)?(s):"") @@ -68,25 +68,21 @@ static PHP_INI_MH(OnChangeCallback) } PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("assert.active", "1", PHP_INI_ALL, OnUpdateLong, active, php_assert_globals, assert_globals) - STD_PHP_INI_ENTRY("assert.bail", "0", PHP_INI_ALL, OnUpdateLong, bail, php_assert_globals, assert_globals) - STD_PHP_INI_ENTRY("assert.warning", "1", PHP_INI_ALL, OnUpdateLong, warning, php_assert_globals, assert_globals) + STD_PHP_INI_ENTRY("assert.active", "1", PHP_INI_ALL, OnUpdateLong, active, zend_assert_globals, assert_globals) + STD_PHP_INI_ENTRY("assert.bail", "0", PHP_INI_ALL, OnUpdateLong, bail, zend_assert_globals, assert_globals) + STD_PHP_INI_ENTRY("assert.warning", "1", PHP_INI_ALL, OnUpdateLong, warning, zend_assert_globals, assert_globals) PHP_INI_ENTRY ("assert.callback", NULL, PHP_INI_ALL, OnChangeCallback) - STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateLong, quiet_eval, php_assert_globals, assert_globals) + STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateLong, quiet_eval, zend_assert_globals, assert_globals) PHP_INI_END() -static void php_assert_init_globals(php_assert_globals *assert_globals_p TSRMLS_DC) +static void php_assert_init_globals(zend_assert_globals *assert_globals_p TSRMLS_DC) { ASSERTG(callback) = NULL; } PHP_MINIT_FUNCTION(assert) { -#ifdef ZTS - ts_allocate_id(&assert_globals_id, sizeof(php_assert_globals), (ts_allocate_ctor) php_assert_init_globals, NULL); -#else - php_assert_init_globals(&assert_globals TSRMLS_CC); -#endif + ZEND_INIT_MODULE_GLOBALS(assert, php_assert_init_globals, NULL); REGISTER_INI_ENTRIES(); @@ -103,6 +99,7 @@ PHP_MSHUTDOWN_FUNCTION(assert) { if (ASSERTG(callback)) { zval_ptr_dtor(&ASSERTG(callback)); + ASSERTG(callback) = NULL; } return SUCCESS; } |
