From da4b42688a6cd5444eefb91bf40183d88203ffca Mon Sep 17 00:00:00 2001 From: Mojca Miklavec Date: Sat, 5 Nov 2022 13:22:25 +0100 Subject: [PATCH] Fix implicit declaration configuration errors with Xcode 12 Some configure could fail with errors like the following: conftest.c:56:33: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] See https://trac.macports.org/ticket/61672 Closes #22946. --- configure | 6 +++++- configure.in | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 609753031f..bab062b4a2 100755 --- a/configure +++ b/configure @@ -25421,6 +25421,7 @@ else #include #include + #include int main() { @@ -25560,6 +25561,7 @@ else #include #include + #include int main() { @@ -36219,7 +36221,9 @@ if ${wx_cv_inotify_usable+:} false; then : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main() { return inotify_init(); } + + #include + int main() { return inotify_init(); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : wx_cv_inotify_usable=yes diff --git a/configure.in b/configure.in index 3e68b66f9c..a21d8531ba 100644 --- a/configure.in +++ b/configure.in @@ -2215,6 +2215,7 @@ if test "$wxUSE_ZLIB" != "no" ; then [ #include #include + #include int main() { @@ -2300,6 +2301,7 @@ if test "$wxUSE_LIBPNG" != "no" ; then [ #include #include + #include int main() { @@ -5086,7 +5088,9 @@ if test "$wxUSE_FSWATCHER" = "yes"; then [whether inotify is usable], wx_cv_inotify_usable, AC_LINK_IFELSE( - [AC_LANG_SOURCE([int main() { return inotify_init(); }])], + [AC_LANG_SOURCE([ + #include + int main() { return inotify_init(); }])], [wx_cv_inotify_usable=yes], [wx_cv_inotify_usable=no] )