diff options
author | foobar <sniper@php.net> | 2001-05-06 17:55:10 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2001-05-06 17:55:10 +0000 |
commit | 6c21f7ef0f88613c26aa0b33abba5c5112d9f004 (patch) | |
tree | 217906eaa0fd5637dea4c33b36b2fd28c7c240ae /ext/standard/lcg.c | |
parent | 8e006f81afa692ebef76e10b75de2b9361a480d5 (diff) | |
download | php-git-6c21f7ef0f88613c26aa0b33abba5c5112d9f004.tar.gz |
Moved ts_alloca_id() into MINIT like Andi requested.
Diffstat (limited to 'ext/standard/lcg.c')
-rw-r--r-- | ext/standard/lcg.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c index 31321a6c81..ca6e8b7fb4 100644 --- a/ext/standard/lcg.c +++ b/ext/standard/lcg.c @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP version 4.0 | +----------------------------------------------------------------------+ @@ -73,18 +73,22 @@ static void lcg_init_globals(LCGLS_D) #endif } +#ifdef ZTS +PHP_MINIT_FUNCTION(lcg) +{ + lcg_globals_id = ts_allocate_id(sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL); + return SUCCESS; +} +#else PHP_RINIT_FUNCTION(lcg) { if (!php_lcg_initialized) { -#ifdef ZTS - lcg_globals_id = ts_allocate_id(sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL); -#else lcg_init_globals(); -#endif php_lcg_initialized = 1; } return SUCCESS; } +#endif /* {{{ proto double lcg_value() Returns a value from the combined linear congruential generator */ |