@@ -664,28 +664,25 @@ AS_VAR_IF([php_cv_func_getaddrinfo], [yes],
664664dnl on FreeBSD, copy_file_range() works only with the undocumented flag 0x01000000;
665665dnl until the problem is fixed properly, copy_file_range() is used only on Linux
666666AC_CACHE_CHECK ( [ for copy_file_range] , [ php_cv_func_copy_file_range] ,
667- [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [
668- #ifdef __linux__
667+ [ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [
668+ #ifndef __linux__
669+ # error "unsupported platform"
670+ #endif
669671#ifndef _GNU_SOURCE
670- #define _GNU_SOURCE
672+ # define _GNU_SOURCE
671673#endif
672674#include <linux/version.h>
673- #include <unistd.h>
674-
675- int main(void) {
676- (void)copy_file_range(-1, 0, -1, 0, 0, 0);
677675#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
678- #error "kernel too old"
679- #else
680- return 0;
676+ # error "kernel too old"
681677#endif
678+ #include <unistd.h>
679+ int main(void)
680+ {
681+ (void)copy_file_range(-1, 0, -1, 0, 0, 0);
682+ return 0;
682683}
683- #else
684- #error "unsupported platform"
685- #endif
686684] ) ] ,
687685[ php_cv_func_copy_file_range=yes] ,
688- [ php_cv_func_copy_file_range=no] ,
689686[ php_cv_func_copy_file_range=no] )
690687] )
691688AS_VAR_IF ( [ php_cv_func_copy_file_range] , [ yes] ,
0 commit comments