mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix -Wimplicit-function-declaration in configure
This commit is contained in:
commit
9ad5381a2f
4 changed files with 49 additions and 34 deletions
|
@ -164,16 +164,16 @@ int main()
|
|||
double d = (double) LONG_MIN * LONG_MIN + 2e9;
|
||||
|
||||
if ((long) d == 2e9 && (long) -d == -2e9) {
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
} else if (sizeof(long) == 8) {
|
||||
double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */
|
||||
|
||||
if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
|
||||
|
@ -284,7 +284,7 @@ int main()
|
|||
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
|
||||
fclose(fp);
|
||||
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
|
||||
|
|
26
build/php.m4
26
build/php.m4
|
@ -1176,14 +1176,14 @@ AC_DEFUN([PHP_DOES_PWRITE_WORK],[
|
|||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
$1
|
||||
main() {
|
||||
int main() {
|
||||
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
|
||||
|
||||
if (fd < 0) exit(1);
|
||||
if (pwrite(fd, "text", 4, 0) != 4) exit(1);
|
||||
if (fd < 0) return 1;
|
||||
if (pwrite(fd, "text", 4, 0) != 4) return 1;
|
||||
/* Linux glibc breakage until 2.2.5 */
|
||||
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
|
||||
exit(0);
|
||||
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
]])],[
|
||||
|
@ -1209,14 +1209,14 @@ AC_DEFUN([PHP_DOES_PREAD_WORK],[
|
|||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
$1
|
||||
main() {
|
||||
int main() {
|
||||
char buf[3];
|
||||
int fd = open("conftest_in", O_RDONLY);
|
||||
if (fd < 0) exit(1);
|
||||
if (pread(fd, buf, 2, 0) != 2) exit(1);
|
||||
if (fd < 0) return 1;
|
||||
if (pread(fd, buf, 2, 0) != 2) return 1;
|
||||
/* Linux glibc breakage until 2.2.5 */
|
||||
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
|
||||
exit(0);
|
||||
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
|
||||
return 0;
|
||||
}
|
||||
]])],[
|
||||
ac_cv_pread=yes
|
||||
|
@ -1478,13 +1478,13 @@ int seeker(void *cookie, off64_t *position, int whence)
|
|||
|
||||
cookie_io_functions_t funcs = {reader, writer, seeker, closer};
|
||||
|
||||
main() {
|
||||
int main() {
|
||||
struct cookiedata g = { 0 };
|
||||
FILE *fp = fopencookie(&g, "r", funcs);
|
||||
|
||||
if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
|
||||
exit(0);
|
||||
exit(1);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
]])], [
|
||||
|
|
11
configure.ac
11
configure.ac
|
@ -662,6 +662,7 @@ dnl getaddrinfo.
|
|||
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
|
||||
[[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef AF_INET
|
||||
|
@ -674,11 +675,11 @@ int main(void) {
|
|||
hints.ai_flags = AI_NUMERICHOST;
|
||||
|
||||
if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ai == 0) {
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pai = ai;
|
||||
|
@ -686,16 +687,16 @@ int main(void) {
|
|||
while (pai) {
|
||||
if (pai->ai_family != AF_INET) {
|
||||
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if (pai->ai_addr->sa_family != AF_INET) {
|
||||
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
pai = pai->ai_next;
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])],
|
||||
[ac_cv_func_getaddrinfo=no])])
|
||||
|
|
|
@ -5,6 +5,8 @@ AC_CACHE_CHECK([whether flush should be called explicitly after a buffered io],
|
|||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
@ -59,6 +61,8 @@ fi
|
|||
|
||||
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -70,9 +74,9 @@ AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
|
|||
int main() {
|
||||
#if HAVE_CRYPT
|
||||
char *encrypted = crypt("rasmuslerdorf","rl");
|
||||
exit(!encrypted || strcmp(encrypted,"rl.3StKT.4T8M"));
|
||||
return !encrypted || strcmp(encrypted,"rl.3StKT.4T8M");
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_des=yes
|
||||
|
@ -84,6 +88,8 @@ int main() {
|
|||
|
||||
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -95,9 +101,9 @@ AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
|
|||
int main() {
|
||||
#if HAVE_CRYPT
|
||||
char *encrypted = crypt("rasmuslerdorf","_J9..rasm");
|
||||
exit(!encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc"));
|
||||
return !encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc");
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_ext_des=yes
|
||||
|
@ -109,6 +115,8 @@ int main() {
|
|||
|
||||
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -130,9 +138,9 @@ int main() {
|
|||
strcpy(answer,salt);
|
||||
strcat(answer,"rISCgZzpwk3UhDidwXvin0");
|
||||
encrypted = crypt("rasmuslerdorf",salt);
|
||||
exit(!encrypted || strcmp(encrypted,answer));
|
||||
return !encrypted || strcmp(encrypted,answer);
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_md5=yes
|
||||
|
@ -144,6 +152,8 @@ int main() {
|
|||
|
||||
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -162,9 +172,9 @@ int main() {
|
|||
strcpy(answer,salt);
|
||||
strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra");
|
||||
encrypted = crypt("rasmuslerdorf",salt);
|
||||
exit(!encrypted || strcmp(encrypted,answer));
|
||||
return !encrypted || strcmp(encrypted,answer);
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_blowfish=yes
|
||||
|
@ -176,6 +186,8 @@ int main() {
|
|||
|
||||
AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_sha512,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -193,9 +205,9 @@ int main() {
|
|||
strcpy(answer, salt);
|
||||
strcat(answer, "EeHCRjm0bljalWuALHSTs1NB9ipEiLEXLhYeXdOpx22gmlmVejnVXFhd84cEKbYxCo.XuUTrW.RLraeEnsvWs/");
|
||||
encrypted = crypt("rasmuslerdorf",salt);
|
||||
exit(!encrypted || strcmp(encrypted,answer));
|
||||
return !encrypted || strcmp(encrypted,answer);
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_sha512=yes
|
||||
|
@ -207,6 +219,8 @@ int main() {
|
|||
|
||||
AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_sha256,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -224,9 +238,9 @@ int main() {
|
|||
strcpy(answer, salt);
|
||||
strcat(answer, "cFAm2puLCujQ9t.0CxiFIIvFi4JyQx5UncCt/xRIX23");
|
||||
encrypted = crypt("rasmuslerdorf",salt);
|
||||
exit(!encrypted || strcmp(encrypted,answer));
|
||||
return !encrypted || strcmp(encrypted,answer);
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_sha256=yes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue