cvs: /php4/ext/standard assert.c
| From: | Sascha Schumann | Date: | Wed, 08 Dec 1999 19:08:29 +0000 |
| Subject: | cvs: /php4/ext/standard assert.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-7682@lists.php.net to get a copy of this message | ||
sas Wed Dec 8 14:08:29 1999 EDT
Modified files:
/php4/ext/standard assert.c
Log:
Use global ctor in non-ZTS mode as well
Index: php4/ext/standard/assert.c
diff -u php4/ext/standard/assert.c:1.9 php4/ext/standard/assert.c:1.10
--- php4/ext/standard/assert.c:1.9 Wed Dec 8 09:18:28 1999
+++ php4/ext/standard/assert.c Wed Dec 8 14:07:58 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: assert.c,v 1.9 1999/12/08 14:18:28 thies Exp $ */
+/* $Id: assert.c,v 1.10 1999/12/08 19:07:58 sas Exp $ */
/* {{{ includes/startup/misc */
@@ -34,10 +34,18 @@
} 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 @@
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 @@
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_MINFO_FUNCTION(assert)
{
- ASSERTLS_FETCH();
-
DISPLAY_INI_ENTRIES();
}