Fix:

conftest.c:29:7: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:26:36: error: implicit declaration of function 'gdk_display_get_default' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
--- configure.orig	2006-02-27 19:45:14.000000000 -0600
+++ configure	2023-07-21 02:10:31.000000000 -0500
@@ -5255,6 +5255,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -20465,6 +20466,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <gdk/gdkdisplay.h>
 #include <gdk/gdkglquery.h>
 int
 main ()