cvs: php4 /ext/bcmath bcmath.c php_bcmath.h

From: Date: Sat, 18 Nov 2000 02:59:31 +0000
Subject: cvs: php4 /ext/bcmath bcmath.c php_bcmath.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2672@lists.php.net to get a copy of this message
zeev Fri Nov 17 18:59:31 2000 EDT Modified files: /php4/ext/bcmath bcmath.c php_bcmath.h Log: Fix thread-safety bug in bcmath Index: php4/ext/bcmath/bcmath.c diff -u php4/ext/bcmath/bcmath.c:1.23 php4/ext/bcmath/bcmath.c:1.24 --- php4/ext/bcmath/bcmath.c:1.23 Sun Oct 8 04:45:17 2000 +++ php4/ext/bcmath/bcmath.c Fri Nov 17 18:59:31 2000 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: bcmath.c,v 1.23 2000/10/08 11:45:17 dbeu Exp $ */ +/* $Id: bcmath.c,v 1.24 2000/11/18 02:59:31 zeev Exp $ */ #include "php.h" @@ -42,10 +42,10 @@ zend_module_entry bcmath_module_entry = { "bcmath", bcmath_functions, - NULL, - NULL, + PHP_MINIT(bcmath), + PHP_MSHUTDOWN(bcmath), PHP_RINIT(bcmath), - PHP_RSHUTDOWN(bcmath), + NULL, PHP_MINFO(bcmath), STANDARD_MODULE_PROPERTIES }; @@ -58,20 +58,29 @@ static long bc_precision; #endif -PHP_RINIT_FUNCTION(bcmath) +PHP_MINIT_FUNCTION(bcmath) { init_numbers(); - if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) { - bc_precision=0; - } return SUCCESS; } + -PHP_RSHUTDOWN_FUNCTION(bcmath) + +PHP_MSHUTDOWN_FUNCTION(bcmath) { destruct_numbers(); return SUCCESS; } + + +PHP_RINIT_FUNCTION(bcmath) +{ + if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) { + bc_precision=0; + } + return SUCCESS; +} + PHP_MINFO_FUNCTION(bcmath) { Index: php4/ext/bcmath/php_bcmath.h diff -u php4/ext/bcmath/php_bcmath.h:1.6 php4/ext/bcmath/php_bcmath.h:1.7 --- php4/ext/bcmath/php_bcmath.h:1.6 Sun Oct 8 04:45:17 2000 +++ php4/ext/bcmath/php_bcmath.h Fri Nov 17 18:59:31 2000 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_bcmath.h,v 1.6 2000/10/08 11:45:17 dbeu Exp $ */ +/* $Id: php_bcmath.h,v 1.7 2000/11/18 02:59:31 zeev Exp $ */ #ifndef PHP_BCMATH_H #define PHP_BCMATH_H @@ -26,8 +26,9 @@ extern zend_module_entry bcmath_module_entry; #define phpext_bcmath_ptr &bcmath_module_entry -extern PHP_RINIT_FUNCTION(bcmath); -extern PHP_RSHUTDOWN_FUNCTION(bcmath); +PHP_MINIT_FUNCTION(bcmath); +PHP_MSHUTDOWN_FUNCTION(bcmath); +PHP_RINIT_FUNCTION(bcmath); PHP_MINFO_FUNCTION(bcmath); PHP_FUNCTION(bcadd);

« previous php.cvs (#2672) next »