Blame texlive-base-c99-1.patch

b6798c0
Backuport of upstream r64941: stdlib.h to placate clang16
963e9ad
963e9ad
2022-11-05  Sam James  <sam@gentoo.org>
963e9ad
963e9ad
	* configure.ac (Ghostscript version): #include <stdlib.h>
963e9ad
	to declare exit and placate clang16.
963e9ad
	https://tug.org/pipermail/tlbuild/2022q4/005269.html
963e9ad
963e9ad
Index: Build/source/texk/dvisvgm/configure
963e9ad
===================================================================
963e9ad
--- Build/source/texk/dvisvgm/configure	(revision 64940)
963e9ad
+++ Build/source/texk/dvisvgm/configure	(revision 64941)
963e9ad
@@ -23415,6 +23415,7 @@
963e9ad
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
963e9ad
 /* end confdefs.h.  */
963e9ad
 #include <stdio.h>
963e9ad
+		#include <stdlib.h>
963e9ad
 		#include <ghostscript/iapi.h>
963e9ad
 		int main () {
963e9ad
 			gsapi_revision_t r;
963e9ad
Index: Build/source/texk/dvisvgm/configure.ac
963e9ad
===================================================================
963e9ad
--- Build/source/texk/dvisvgm/configure.ac	(revision 64940)
963e9ad
+++ Build/source/texk/dvisvgm/configure.ac	(revision 64941)
963e9ad
@@ -94,6 +94,7 @@
963e9ad
 	# query Ghostscript version
963e9ad
 	AC_MSG_CHECKING([Ghostscript version])
963e9ad
 	AC_RUN_IFELSE([AC_LANG_SOURCE([#include <stdio.h>
963e9ad
+		#include <stdlib.h>
963e9ad
 		#include <ghostscript/iapi.h>
963e9ad
 		int main () {
963e9ad
 			gsapi_revision_t r;
963e9ad
Index: Build/source/texk/kpathsea/configure
963e9ad
===================================================================
963e9ad
--- Build/source/texk/kpathsea/configure	(revision 64940)
963e9ad
+++ Build/source/texk/kpathsea/configure	(revision 64941)
963e9ad
@@ -14633,7 +14633,8 @@
963e9ad
 else $as_nop
963e9ad
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
963e9ad
 /* end confdefs.h.  */
963e9ad
-int fork() { exit(1); }
963e9ad
+#include <stdlib.h>
963e9ad
+                                                 int fork() { exit(1); }
963e9ad
                                                  int vfork() { exit(1); }
963e9ad
                                                  extern char *getcwd();
963e9ad
                                                  char path[100];
963e9ad
Index: Build/source/texk/kpathsea/configure.ac
963e9ad
===================================================================
963e9ad
--- Build/source/texk/kpathsea/configure.ac	(revision 64940)
963e9ad
+++ Build/source/texk/kpathsea/configure.ac	(revision 64941)
963e9ad
@@ -45,7 +45,8 @@
963e9ad
 # We only need to run this if we have getcwd.
963e9ad
 AC_CACHE_CHECK([whether getcwd uses fork or vfork],
963e9ad
                [kb_cv_func_getcwd_forks],
963e9ad
-               [AC_RUN_IFELSE([AC_LANG_PROGRAM([[int fork() { exit(1); }
963e9ad
+               [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
963e9ad
+                                                 int fork() { exit(1); }
963e9ad
                                                  int vfork() { exit(1); }
963e9ad
                                                  extern char *getcwd();
963e9ad
                                                  char path[100];]],