configure: Fix failing libpng and zlib detection

Since Apple clang version 12 implicit function declarations by default
are (rightfully) an error resulting in failure to compile the configure
tests for libpng and zlib, which make implicit use of exit.

Fix by using return statements (another solution is including stdlib.h).
This commit is contained in:
Dimitri Schoolwerth
2020-12-16 23:22:14 +01:00
committed by Dimitri Schoolwerth
parent d2fc88c03d
commit f6a43a6074
2 changed files with 8 additions and 8 deletions

8
configure vendored
View File

@@ -21547,13 +21547,13 @@ else
int main() int main()
{ {
FILE *f=fopen("conftestval", "w"); FILE *f=fopen("conftestval", "w");
if (!f) exit(1); if (!f) return 1;
fprintf(f, "%s", fprintf(f, "%s",
ZLIB_VERSION[0] == '1' && ZLIB_VERSION[0] == '1' &&
(ZLIB_VERSION[2] > '1' || (ZLIB_VERSION[2] > '1' ||
(ZLIB_VERSION[2] == '1' && (ZLIB_VERSION[2] == '1' &&
ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); ZLIB_VERSION[4] >= '4')) ? "yes" : "no");
exit(0); return 0;
} }
_ACEOF _ACEOF
@@ -21686,10 +21686,10 @@ else
int main() int main()
{ {
FILE *f=fopen("conftestval", "w"); FILE *f=fopen("conftestval", "w");
if (!f) exit(1); if (!f) return 1;
fprintf(f, "%s", fprintf(f, "%s",
PNG_LIBPNG_VER > 90 ? "yes" : "no"); PNG_LIBPNG_VER > 90 ? "yes" : "no");
exit(0); return 0;
} }
_ACEOF _ACEOF

View File

@@ -2451,13 +2451,13 @@ if test "$wxUSE_ZLIB" != "no" ; then
int main() int main()
{ {
FILE *f=fopen("conftestval", "w"); FILE *f=fopen("conftestval", "w");
if (!f) exit(1); if (!f) return 1;
fprintf(f, "%s", fprintf(f, "%s",
ZLIB_VERSION[0] == '1' && ZLIB_VERSION[0] == '1' &&
(ZLIB_VERSION[2] > '1' || (ZLIB_VERSION[2] > '1' ||
(ZLIB_VERSION[2] == '1' && (ZLIB_VERSION[2] == '1' &&
ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); ZLIB_VERSION[4] >= '4')) ? "yes" : "no");
exit(0); return 0;
} }
], ],
ac_cv_header_zlib_h=`cat conftestval`, ac_cv_header_zlib_h=`cat conftestval`,
@@ -2536,10 +2536,10 @@ if test "$wxUSE_LIBPNG" != "no" ; then
int main() int main()
{ {
FILE *f=fopen("conftestval", "w"); FILE *f=fopen("conftestval", "w");
if (!f) exit(1); if (!f) return 1;
fprintf(f, "%s", fprintf(f, "%s",
PNG_LIBPNG_VER > 90 ? "yes" : "no"); PNG_LIBPNG_VER > 90 ? "yes" : "no");
exit(0); return 0;
} }
], ],
ac_cv_header_png_h=`cat conftestval`, ac_cv_header_png_h=`cat conftestval`,