diff --git a/wxGTK-configure-c99.patch b/wxGTK-configure-c99.patch
new file mode 100644
index 0000000..e3c068c
--- /dev/null
+++ b/wxGTK-configure-c99.patch
@@ -0,0 +1,54 @@
+Include <sys/inotify.h> in the inotify_init probe, to avoid
+an implicit function declaration.  Future compilers are likely
+to reject implicit function declarations by default, making
+the configure check invalid as written.
+
+Fixed upstream via:
+
+commit da4b42688a6cd5444eefb91bf40183d88203ffca
+Author: Mojca Miklavec <mojca@macports.org>
+Date:   Sat Nov 5 13:22:25 2022 +0100
+
+    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.
+
+
+diff --git a/configure b/configure
+index 54eb7a74f95d4dd2..232d202cc5da2345 100755
+--- a/configure
++++ b/configure
+@@ -37928,7 +37916,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 <sys/inotify.h>
++		    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 c76c528f6635bece..bf6a33b3c10dc27a 100644
+--- a/configure.in
++++ b/configure.in
+@@ -5622,7 +5622,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 <sys/inotify.h>
++		    int main() { return inotify_init(); }])],
+                     [wx_cv_inotify_usable=yes],
+                     [wx_cv_inotify_usable=no]
+                 )
diff --git a/wxGTK.spec b/wxGTK.spec
index c637e4e..2664388 100644
--- a/wxGTK.spec
+++ b/wxGTK.spec
@@ -5,7 +5,7 @@
 
 Name:           wxGTK
 Version:        3.2.1
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        GTK port of the wxWidgets GUI library
 License:        wxWidgets
 URL:            https://www.wxwidgets.org/
@@ -16,6 +16,7 @@ Source10:       wx-config
 # remove abort when ABI check fails
 # Backport from wxGTK
 Patch0:         %{name}-3.1.6-abicheck.patch
+Patch1:         wxGTK-configure-c99.patch
 
 BuildRequires: make
 BuildRequires:  gcc-c++
@@ -314,6 +315,9 @@ fi
 %doc html
 
 %changelog
+* Wed Dec 14 2022 Florian Weimer <fweimer@redhat.com> - 3.2.1-4
+- Port configure script to C99
+
 * Tue Nov 22 2022 Scott Talbert <swt@techie.net> - 3.2.1-3
 - Rebuild (again) with wxGLCanvas GLX support (resolves many OpenGL issues)