From f6a43a6074bf1429a6e34bd79da5bf9fe4df5a7c Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Wed, 16 Dec 2020 23:22:14 +0100 Subject: [PATCH] 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). --- configure | 8 ++++---- configure.in | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configure b/configure index 1d0a19b710..c223953c55 100755 --- a/configure +++ b/configure @@ -21547,13 +21547,13 @@ else int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return 1; fprintf(f, "%s", ZLIB_VERSION[0] == '1' && (ZLIB_VERSION[2] > '1' || (ZLIB_VERSION[2] == '1' && ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); - exit(0); + return 0; } _ACEOF @@ -21686,10 +21686,10 @@ else int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return 1; fprintf(f, "%s", PNG_LIBPNG_VER > 90 ? "yes" : "no"); - exit(0); + return 0; } _ACEOF diff --git a/configure.in b/configure.in index 60f8846056..72b3ad0e17 100644 --- a/configure.in +++ b/configure.in @@ -2451,13 +2451,13 @@ if test "$wxUSE_ZLIB" != "no" ; then int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return 1; fprintf(f, "%s", ZLIB_VERSION[0] == '1' && (ZLIB_VERSION[2] > '1' || (ZLIB_VERSION[2] == '1' && ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); - exit(0); + return 0; } ], ac_cv_header_zlib_h=`cat conftestval`, @@ -2536,10 +2536,10 @@ if test "$wxUSE_LIBPNG" != "no" ; then int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return 1; fprintf(f, "%s", PNG_LIBPNG_VER > 90 ? "yes" : "no"); - exit(0); + return 0; } ], ac_cv_header_png_h=`cat conftestval`,