From 09e48a05b98b94fd52dc2562089f67e8d1279298 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 4 Feb 2020 09:37:24 +0100 Subject: update to 2.0.0 (alpha) raise dependency on PHP 7.2 fix undefined symbol using patch from https://github.com/php-decimal/ext-decimal/pull/34 disable ZTS build which segfaults, reported as https://github.com/php-decimal/ext-decimal/issues/35 --- 34.patch | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 34.patch (limited to '34.patch') diff --git a/34.patch b/34.patch new file mode 100644 index 0000000..d883be8 --- /dev/null +++ b/34.patch @@ -0,0 +1,111 @@ +From e71f1488b666e30e4f0121a10fee3eeab22bd327 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 4 Feb 2020 08:23:05 +0100 +Subject: [PATCH 1/3] fix harcoded path in test + +--- + tests/Number/methods/pow.phpt | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/Number/methods/pow.phpt b/tests/Number/methods/pow.phpt +index 5ce6582..2c78f16 100644 +--- a/tests/Number/methods/pow.phpt ++++ b/tests/Number/methods/pow.phpt +@@ -87,7 +87,7 @@ Number Object + ) + Number::pow + +-Warning: Decimal arithmetic operand truncated to integer in /Users/rtheunissen/dev/decimal/ext-decimal/tests/Number/helpers/Number.php on line 63 ++Warning: Decimal arithmetic operand truncated to integer in %sNumber.php on line 63 + Number Object + ( + [value:protected] => Decimal\Rational Object +@@ -99,7 +99,7 @@ Number Object + ) + Number::pow + +-Warning: Decimal arithmetic operand truncated to integer in /Users/rtheunissen/dev/decimal/ext-decimal/tests/Number/helpers/Number.php on line 63 ++Warning: Decimal arithmetic operand truncated to integer in %sNumber.php on line 63 + Number Object + ( + [value:protected] => Decimal\Rational Object +@@ -123,7 +123,7 @@ Decimal\Decimal Object + ) + Number::toRational + +-Warning: Decimal arithmetic operand truncated to integer in /Users/rtheunissen/dev/decimal/ext-decimal/tests/Number/methods/pow.php on line 38 ++Warning: Decimal arithmetic operand truncated to integer in %spow.php on line 38 + Decimal\Rational Object + ( + [num] => 16 +@@ -131,7 +131,7 @@ Decimal\Rational Object + ) + Number::toRational + +-Warning: Decimal arithmetic operand truncated to integer in /Users/rtheunissen/dev/decimal/ext-decimal/tests/Number/methods/pow.php on line 41 ++Warning: Decimal arithmetic operand truncated to integer in %spow.php on line 41 + Decimal\Rational Object + ( + [num] => 16 + +From d983b8f76f59996339a434c40d1f57703fadbd42 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 4 Feb 2020 08:25:35 +0100 +Subject: [PATCH 3/3] fix #33 remomve unused function + +--- + src/convert.c | 15 +-------------- + src/convert.h | 2 -- + 2 files changed, 1 insertion(+), 16 deletions(-) + +diff --git a/src/convert.c b/src/convert.c +index 4136a35..77581e3 100644 +--- a/src/convert.c ++++ b/src/convert.c +@@ -444,19 +444,6 @@ zend_string *php_decimal_rational_to_sci(const php_rational_t *obj, zend_long pr + return str; + } + +-zend_string *php_decimal_rational_to_eng(const php_rational_t *obj, zend_long prec) +-{ +- zend_string *str; +- +- PHP_DECIMAL_TEMP_MPD(tmp); +- php_decimal_rational_evaluate(&tmp, obj, prec); +- +- str = php_decimal_mpd_to_eng(&tmp); +- mpd_del(&tmp); +- +- return str; +-} +- + zend_string *php_decimal_rational_to_fixed(const php_rational_t *obj, zend_long places, zend_bool commas, php_decimal_rounding_t mode) + { + PHP_DECIMAL_TEMP_MPD(tmp); +@@ -597,4 +584,4 @@ void php_decimal_number_to_num_den(mpd_t *num, mpd_t *den, const zval *obj) + + assert(status == 0); + zval_ptr_dtor(&result); +-} +\ No newline at end of file ++} +diff --git a/src/convert.h b/src/convert.h +index cb5e031..a3924e3 100644 +--- a/src/convert.h ++++ b/src/convert.h +@@ -56,7 +56,6 @@ php_decimal_success_t php_decimal_mpd_set_string(mpd_t *mpd, const zend_string * + php_decimal_success_t php_decimal_mpd_set_charptr(mpd_t *mpd, const char *str); + + zend_string *php_decimal_mpd_to_serialized(const mpd_t *mpd); +-zend_string *php_decimal_mpd_to_eng(const mpd_t *mpd); + zend_string *php_decimal_mpd_to_sci(const mpd_t *mpd); + zend_string *php_decimal_mpd_to_string(const mpd_t *mpd); + zend_string *php_decimal_mpd_to_fixed(const mpd_t *mpd, zend_long places, zend_bool commas, php_decimal_rounding_t mode); +@@ -69,7 +68,6 @@ void php_decimal_rational_set_nan(php_rational_t *obj); + void php_decimal_rational_set_zero(php_rational_t *obj); + + zend_string *php_decimal_rational_to_sci(const php_rational_t *obj, zend_long prec); +-zend_string *php_decimal_rational_to_eng(const php_rational_t *obj, zend_long prec); + zend_string *php_decimal_rational_to_string(const php_rational_t *obj); + zend_string *php_decimal_rational_to_fixed(const php_rational_t *obj, zend_long places, zend_bool commas, php_decimal_rounding_t mode); + zend_long php_decimal_rational_to_long(const php_rational_t *obj); -- cgit