]> granicus.if.org Git - php/commitdiff
Fixed build (missing function borrowed from PHP-7.2)
authorDmitry Stogov <dmitry@zend.com>
Tue, 7 Nov 2017 06:25:04 +0000 (09:25 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 7 Nov 2017 06:25:04 +0000 (09:25 +0300)
ext/bcmath/bcmath.c

index 250c751d7a26a57ae89f6948d696bd8d2fc7d64f..121d193514cbf59450a7dee0ad2e883101cbe9dd 100644 (file)
@@ -208,6 +208,21 @@ static void php_str2num(bc_num *num, char *str)
 }
 /* }}} */
 
+/* {{{ split_bc_num
+   Convert to bc_num detecting scale */
+static bc_num split_bc_num(bc_num num) {
+       bc_num newnum;
+       if (num->n_refs >= 1) {
+               return num;
+       }
+       newnum = _bc_new_num_ex(0, 0, 0);
+       *newnum = *num;
+       newnum->n_refs = 1;
+       num->n_refs--;
+       return newnum;
+}
+/* }}} */
+
 /* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
    Returns the sum of two arbitrary precision numbers */
 PHP_FUNCTION(bcadd)