Better alloca() support under Win32
carlo.bramix
carlo.bramix at libero.it
Fri Mar 14 02:11:24 PDT 2008
Hello,
I would like to suggest this fix for pkg-config.
I added the test on malloc.h into the configure script and I also added the code into some sources for including this file if it is found.
This is a recommended action to do when compiling under Win32 because it will allow to recognize the alloca() function as intrinsic (it's better and it removes the warnings at compile time).
Sincerely,
Carlo Bramini.
=========================================
--- /home/pc/old-pkg-config-0.23/configure.in Wed Jan 16 23:48:07 2008
+++ /home/pc/pkg-config-0.23/configure.in Thu Mar 13 18:30:34 2008
@@ -128,6 +128,6 @@
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(setresuid setreuid,break)
-AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h])
+AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h])
AC_OUTPUT([Makefile check/Makefile])
--- /home/pc/old-pkg-config-0.23/findme.c Wed Jan 16 21:42:49 2008
+++ /home/pc/pkg-config-0.23/findme.c Thu Mar 13 18:44:30 2008
@@ -30,6 +30,10 @@
# endif
#endif
+#ifdef HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
--- /home/pc/old-pkg-config-0.23/pkg.c Wed Jan 16 22:59:49 2008
+++ /home/pc/pkg-config-0.23/pkg.c Thu Mar 13 18:44:38 2008
@@ -33,6 +33,10 @@
# endif
#endif
+#ifdef HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
--- /home/pc/old-pkg-config-0.23/popt.c Wed Jan 16 21:42:49 2008
+++ /home/pc/pkg-config-0.23/popt.c Thu Mar 13 18:44:46 2008
@@ -29,6 +29,10 @@
# endif
#endif
+#ifdef HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+
#include <errno.h>
#include <ctype.h>
#include <fcntl.h>
--- /home/pc/old-pkg-config-0.23/poptconfig.c Wed Jan 16 21:42:49 2008
+++ /home/pc/pkg-config-0.23/poptconfig.c Thu Mar 13 18:44:28 2008
@@ -35,6 +35,10 @@
# endif
#endif
+#ifdef HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
--- /home/pc/old-pkg-config-0.23/popthelp.c Wed Jan 16 21:42:49 2008
+++ /home/pc/pkg-config-0.23/popthelp.c Thu Mar 13 18:45:06 2008
@@ -35,6 +35,10 @@
# endif
#endif
+#ifdef HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
--- /home/pc/old-pkg-config-0.23/poptparse.c Wed Jan 16 21:42:49 2008
+++ /home/pc/pkg-config-0.23/poptparse.c Thu Mar 13 18:45:26 2008
@@ -35,6 +35,10 @@
# endif
#endif
+#ifdef HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
More information about the pkg-config
mailing list