diff options
author | Sascha Schumann <sas@php.net> | 1999-12-08 19:07:58 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-12-08 19:07:58 +0000 |
commit | 01c7fc6c8fe8f03212c91db330671c0cfd805505 (patch) | |
tree | b8a58f7e61c1f5a3761443bc71acfabb62a5f894 | |
parent | 276c0a378df910c3fa6f28c8b8bb2f45f4b2a975 (diff) | |
download | php-git-01c7fc6c8fe8f03212c91db330671c0cfd805505.tar.gz |
Use global ctor in non-ZTS mode as well
-rw-r--r-- | ext/standard/assert.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 08cb61db9f..87d5222679 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -34,10 +34,18 @@ typedef struct { } php_assert_globals; #ifdef ZTS +#define ASSERTLS_D php_assert_globals *assert_globals +#define ASSERTLS_DC , ASSERTLS_D +#define ASSERTLS_C assert_globals +#define ASSERTLS_CC , ASSERTLS_CC #define ASSERT(v) (assert_globals->v) #define ASSERTLS_FETCH() php_assert_globals *assert_globals = ts_resource(assert_globals_id) int assert_globals_id; #else +#define ASSERTLS_D +#define ASSERTLS_DC +#define ASSERTLS_C +#define ASSERTLS_CC #define ASSERT(v) (assert_globals.v) #define ASSERTLS_FETCH() php_assert_globals assert_globals; @@ -86,12 +94,10 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateInt, quiet_eval, php_assert_globals, assert_globals) PHP_INI_END() -#ifdef ZTS -static void php_assert_init_globals(php_assert_globals *assert_globals) +static void php_assert_init_globals(ASSERTLS_D) { ASSERT(callback) = 0; } -#endif PHP_MINIT_FUNCTION(assert) { @@ -100,7 +106,7 @@ PHP_MINIT_FUNCTION(assert) ELS_FETCH(); assert_globals_id = ts_allocate_id(sizeof(php_assert_globals), (ts_allocate_ctor) php_assert_init_globals, NULL); #else - ASSERT(callback) = 0; + php_assert_init_globals(ASSERTLS_C); #endif REGISTER_INI_ENTRIES(); @@ -145,8 +151,6 @@ PHP_RSHUTDOWN_FUNCTION(assert) PHP_MINFO_FUNCTION(assert) { - ASSERTLS_FETCH(); - DISPLAY_INI_ENTRIES(); } |