diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-04 20:41:42 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-04 20:41:48 +0200 |
commit | 7c3078737fcdd7c4da0607b2856502089e60194b (patch) | |
tree | c4e37fd2cd962616072b7324d78c7c6a5c6255d2 /ext/bcmath | |
parent | a43bc33fb2575cda582167c0d6571e501a2e6496 (diff) | |
download | php-git-7c3078737fcdd7c4da0607b2856502089e60194b.tar.gz |
Generate function entries from stubs for a couple of extensions
Closes GH-5347
Diffstat (limited to 'ext/bcmath')
-rw-r--r-- | ext/bcmath/bcmath.c | 16 | ||||
-rw-r--r-- | ext/bcmath/bcmath.stub.php | 2 | ||||
-rw-r--r-- | ext/bcmath/bcmath_arginfo.h | 27 | ||||
-rw-r--r-- | ext/bcmath/php_bcmath.h | 11 |
4 files changed, 30 insertions, 26 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 5d0d47f7c0..8c46ee0f93 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -33,24 +33,10 @@ ZEND_DECLARE_MODULE_GLOBALS(bcmath) static PHP_GINIT_FUNCTION(bcmath); static PHP_GSHUTDOWN_FUNCTION(bcmath); -static const zend_function_entry bcmath_functions[] = { - PHP_FE(bcadd, arginfo_bcadd) - PHP_FE(bcsub, arginfo_bcsub) - PHP_FE(bcmul, arginfo_bcmul) - PHP_FE(bcdiv, arginfo_bcdiv) - PHP_FE(bcmod, arginfo_bcmod) - PHP_FE(bcpow, arginfo_bcpow) - PHP_FE(bcsqrt, arginfo_bcsqrt) - PHP_FE(bcscale, arginfo_bcscale) - PHP_FE(bccomp, arginfo_bccomp) - PHP_FE(bcpowmod, arginfo_bcpowmod) - PHP_FE_END -}; - zend_module_entry bcmath_module_entry = { STANDARD_MODULE_HEADER, "bcmath", - bcmath_functions, + ext_functions, PHP_MINIT(bcmath), PHP_MSHUTDOWN(bcmath), NULL, diff --git a/ext/bcmath/bcmath.stub.php b/ext/bcmath/bcmath.stub.php index 0a975352bb..6ef6cc0926 100644 --- a/ext/bcmath/bcmath.stub.php +++ b/ext/bcmath/bcmath.stub.php @@ -1,5 +1,7 @@ <?php +/** @generate-function-entries */ + function bcadd(string $left_operand, string $right_operand, int $scale = UNKNOWN): string {} function bcsub(string $left_operand, string $right_operand, int $scale = UNKNOWN): string {} diff --git a/ext/bcmath/bcmath_arginfo.h b/ext/bcmath/bcmath_arginfo.h index dd246518dc..61f0092b45 100644 --- a/ext/bcmath/bcmath_arginfo.h +++ b/ext/bcmath/bcmath_arginfo.h @@ -45,3 +45,30 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcscale, 0, 0, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, scale, IS_LONG, 0) ZEND_END_ARG_INFO() + + +ZEND_FUNCTION(bcadd); +ZEND_FUNCTION(bcsub); +ZEND_FUNCTION(bcmul); +ZEND_FUNCTION(bcdiv); +ZEND_FUNCTION(bcmod); +ZEND_FUNCTION(bcpowmod); +ZEND_FUNCTION(bcpow); +ZEND_FUNCTION(bcsqrt); +ZEND_FUNCTION(bccomp); +ZEND_FUNCTION(bcscale); + + +static const zend_function_entry ext_functions[] = { + ZEND_FE(bcadd, arginfo_bcadd) + ZEND_FE(bcsub, arginfo_bcsub) + ZEND_FE(bcmul, arginfo_bcmul) + ZEND_FE(bcdiv, arginfo_bcdiv) + ZEND_FE(bcmod, arginfo_bcmod) + ZEND_FE(bcpowmod, arginfo_bcpowmod) + ZEND_FE(bcpow, arginfo_bcpow) + ZEND_FE(bcsqrt, arginfo_bcsqrt) + ZEND_FE(bccomp, arginfo_bccomp) + ZEND_FE(bcscale, arginfo_bcscale) + ZEND_FE_END +}; diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h index 5c97780ead..bafaf29e7a 100644 --- a/ext/bcmath/php_bcmath.h +++ b/ext/bcmath/php_bcmath.h @@ -29,17 +29,6 @@ PHP_MINIT_FUNCTION(bcmath); PHP_MSHUTDOWN_FUNCTION(bcmath); PHP_MINFO_FUNCTION(bcmath); -PHP_FUNCTION(bcadd); -PHP_FUNCTION(bcsub); -PHP_FUNCTION(bcmul); -PHP_FUNCTION(bcdiv); -PHP_FUNCTION(bcmod); -PHP_FUNCTION(bcpow); -PHP_FUNCTION(bcsqrt); -PHP_FUNCTION(bccomp); -PHP_FUNCTION(bcscale); -PHP_FUNCTION(bcpowmod); - ZEND_BEGIN_MODULE_GLOBALS(bcmath) bc_num _zero_; bc_num _one_; |