mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
Made bcmath extension thread safe.
@Made bcmath extension thread safe. (Sander)
This commit is contained in:
parent
64a75d6d77
commit
f200f739d8
14 changed files with 186 additions and 202 deletions
|
@ -52,6 +52,9 @@ typedef struct bc_struct
|
|||
in the case of leading zeros generated. */
|
||||
} bc_struct;
|
||||
|
||||
#include <php.h>
|
||||
#include <ext/bcmath/php_bcmath.h>
|
||||
|
||||
|
||||
/* The base used in storing the numbers in n_value above.
|
||||
Currently this MUST be 10. */
|
||||
|
@ -81,12 +84,6 @@ typedef struct bc_struct
|
|||
#endif
|
||||
|
||||
|
||||
/* Global numbers. */
|
||||
extern bc_num _zero_;
|
||||
extern bc_num _one_;
|
||||
extern bc_num _two_;
|
||||
|
||||
|
||||
/* Function Prototypes */
|
||||
|
||||
/* Define the _PROTOTYPE macro if it is needed. */
|
||||
|
@ -99,7 +96,7 @@ extern bc_num _two_;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
_PROTOTYPE(void bc_init_numbers, (void));
|
||||
_PROTOTYPE(void bc_init_numbers, (TSRMLS_D));
|
||||
|
||||
_PROTOTYPE(bc_num bc_new_num, (int length, int scale));
|
||||
|
||||
|
@ -107,9 +104,9 @@ _PROTOTYPE(void bc_free_num, (bc_num *num));
|
|||
|
||||
_PROTOTYPE(bc_num bc_copy_num, (bc_num num));
|
||||
|
||||
_PROTOTYPE(void bc_init_num, (bc_num *num));
|
||||
_PROTOTYPE(void bc_init_num, (bc_num *num TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale));
|
||||
_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(char *bc_num2str, (bc_num num));
|
||||
|
||||
|
@ -119,7 +116,7 @@ _PROTOTYPE(long bc_num2long, (bc_num num));
|
|||
|
||||
_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2));
|
||||
|
||||
_PROTOTYPE(char bc_is_zero, (bc_num num));
|
||||
_PROTOTYPE(char bc_is_zero, (bc_num num TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale));
|
||||
|
||||
|
@ -129,26 +126,26 @@ _PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
|
|||
|
||||
_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
|
||||
|
||||
_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale));
|
||||
_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale));
|
||||
_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result,
|
||||
int scale));
|
||||
int scale TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot,
|
||||
bc_num *rem, int scale));
|
||||
bc_num *rem, int scale TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod,
|
||||
bc_num *result, int scale));
|
||||
bc_num *result, int scale TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result,
|
||||
int scale));
|
||||
int scale TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale));
|
||||
_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale TSRMLS_DC));
|
||||
|
||||
_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int),
|
||||
int leading_zero));
|
||||
int leading_zero TSRMLS_DC));
|
||||
|
||||
/* Prototypes needed for external utility routines. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue