PHP_MINIT(crypt)(INIT_FUNC_ARGS_PASSTHRU);
#endif
+#ifdef ZTS
+ PHP_MINIT(lcg)(INIT_FUNC_ARGS_PASSTHRU);
+#endif
+
PHP_MINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
PHP_MINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
PHP_MINIT(array)(INIT_FUNC_ARGS_PASSTHRU);
PHP_RINIT(crypt)(INIT_FUNC_ARGS_PASSTHRU);
#endif
+#ifndef ZTS
PHP_RINIT(lcg)(INIT_FUNC_ARGS_PASSTHRU);
+#endif
+
PHP_RINIT(head)(INIT_FUNC_ARGS_PASSTHRU);
PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU);
PHP_RINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
-/*
+/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
#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 */
double php_combined_lcg(void);
PHP_FUNCTION(lcg_value);
-PHP_RINIT_FUNCTION(lcg);
#ifdef ZTS
+PHP_MINIT_FUNCTION(lcg);
#define LCGLS_D php_lcg_globals *lcg_globals
#define LCG(v) (lcg_globals->v)
#define LCGLS_FETCH() php_lcg_globals *lcg_globals = ts_resource(lcg_globals_id)
#else
+PHP_RINIT_FUNCTION(lcg);
#define LCGLS_D void
#define LCG(v) (lcg_globals.v)
#define LCGLS_FETCH()