Skip to content
Merged
1 change: 1 addition & 0 deletions .github/actions/freebsd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ runs:
with:
release: '13.3'
usesh: true
copyback: false
# Temporarily disable sqlite, as FreeBSD ships it with disabled double quotes. We'll need to fix our tests.
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269889
prepare: |
Expand Down
6 changes: 5 additions & 1 deletion ext/gmp/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include "ext/random/php_random.h"
#include "ext/random/php_random_csprng.h"

#ifndef mpz_fits_si_p
# define mpz_fits_si_p mpz_fits_slong_p
#endif

#define GMP_ROUND_ZERO 0
#define GMP_ROUND_PLUSINF 1
#define GMP_ROUND_MINUSINF 2
Expand Down Expand Up @@ -293,7 +297,7 @@ static zend_result gmp_cast_object(zend_object *readobj, zval *writeobj, int typ
return SUCCESS;
case _IS_NUMBER:
gmpnum = GET_GMP_OBJECT_FROM_OBJ(readobj)->num;
if (mpz_fits_slong_p(gmpnum)) {
if (mpz_fits_si_p(gmpnum)) {
ZVAL_LONG(writeobj, mpz_get_si(gmpnum));
} else {
ZVAL_DOUBLE(writeobj, mpz_get_d(gmpnum));
Expand Down
11 changes: 11 additions & 0 deletions ext/gmp/tests/gh16890.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--TEST--
GH-16890 (array_sum() with GMP can loose precision (LLP64))
--EXTENSIONS--
gmp
--FILE--
<?php
$large_int_string = (string) (PHP_INT_MAX - 1);
var_dump(array_sum([new GMP($large_int_string), 1]) === PHP_INT_MAX);
?>
--EXPECT--
bool(true)
17 changes: 0 additions & 17 deletions ext/standard/dns_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@

#include "php_dns.h"

#define PHP_DNS_NUM_TYPES 12 /* Number of DNS Types Supported by PHP currently */

#define PHP_DNS_A 0x00000001
#define PHP_DNS_NS 0x00000002
#define PHP_DNS_CNAME 0x00000010
#define PHP_DNS_SOA 0x00000020
#define PHP_DNS_PTR 0x00000800
#define PHP_DNS_HINFO 0x00001000
#define PHP_DNS_MX 0x00004000
#define PHP_DNS_TXT 0x00008000
#define PHP_DNS_A6 0x01000000
#define PHP_DNS_SRV 0x02000000
#define PHP_DNS_NAPTR 0x04000000
#define PHP_DNS_AAAA 0x08000000
#define PHP_DNS_ANY 0x10000000
#define PHP_DNS_ALL (PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_AAAA)

PHP_FUNCTION(dns_get_mx) /* {{{ */
{
char *hostname;
Expand Down
16 changes: 8 additions & 8 deletions ext/standard/tests/file/copy_variation5-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ fclose($file_handle);
$dest_files = array(

/* Checking case sensitiveness */
"COPY.tmp",
"COPY.TMP",
"CopY.TMP"
"COPY5.tmp",
"COPY5.TMP",
"CopY5.TMP"
);

echo "Size of the source file before copy operation => ";
Expand Down Expand Up @@ -80,25 +80,25 @@ Size of the source file before copy operation => int(1500)
-- Iteration 1 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/COPY.tmp
Destination file name => %s/COPY5.tmp
Size of source file => int(1500)
Size of destination file => int(1500)

-- Iteration 2 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/COPY.TMP
Destination file name => %s/COPY5.TMP
Size of source file => int(1500)
Size of destination file => int(1500)

-- Iteration 3 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/CopY.TMP
Destination file name => %s/CopY5.TMP
Size of source file => int(1500)
Size of destination file => int(1500)

Warning: unlink(%s/COPY.TMP): No such file or directory in %s on line %d
Warning: unlink(%s/COPY5.TMP): No such file or directory in %s on line %d

Warning: unlink(%s/CopY.TMP): No such file or directory in %s on line %d
Warning: unlink(%s/CopY5.TMP): No such file or directory in %s on line %d
*** Done ***