diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-10-05 10:43:58 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-10-05 10:43:58 +0200 |
commit | aa405b7da270595d349d0596ad31305a41d4b1c0 (patch) | |
tree | 20800891a990c064250ccf40b63c66c4e7de0c57 /acinclude.m4 | |
parent | bf6873a18e3b6b00f82a645c0893a281ae8eadb8 (diff) | |
download | php-git-aa405b7da270595d349d0596ad31305a41d4b1c0.tar.gz |
Fix -Wimplicit-function-declaration in configure
As this is an error with xcode 12, see bug #80171.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 45e1af0e66..f9f6b08f56 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1209,14 +1209,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; } ]])],[ @@ -1239,14 +1239,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 @@ -1347,25 +1347,26 @@ AC_DEFUN([PHP_READDIR_R_TYPE],[ #define _REENTRANT #include <sys/types.h> #include <dirent.h> +#include <unistd.h> #ifndef PATH_MAX #define PATH_MAX 1024 #endif -main() { +int main() { DIR *dir; char entry[sizeof(struct dirent)+PATH_MAX]; struct dirent *pentry = (struct dirent *) &entry; dir = opendir("/"); if (!dir) - exit(1); + return 1; if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) { close(dir); - exit(0); + return 0; } close(dir); - exit(1); + return 1; } ]])],[ ac_cv_what_readdir_r=POSIX @@ -1693,6 +1694,7 @@ AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND], [ AC_CACHE_VAL(_cv_have_broken_glibc_fopen_append,[ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <stdio.h> +#include <unistd.h> int main(int argc, char *argv[]) { FILE *fp; @@ -1702,7 +1704,7 @@ int main(int argc, char *argv[]) fp = fopen(filename, "w"); if (fp == NULL) { perror("fopen"); - exit(2); + return 2; } fputs("foobar", fp); fclose(fp); @@ -1812,13 +1814,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; } ]])], [ |