[PATCH] [TRIVIAL] libiberty, fix includes for mktemp()

Ozkan Sezer sezeroz@gmail.com
Sat Sep 5 20:30:00 GMT 2009


Hello:  The folllowing trivial patch fixes warnings emitted from
libiberty/choose-temp.c in mingw* builds:
choose-temp.c:68: warning: implicit declaration of function 'mktemp'
Mingw* headers declare mktemp() in io.h which is included from
unistd.h.

--- a/libiberty/choose-temp.c	2007-01-31 22:05:50.000000000 +0200
+++ b/libiberty/choose-temp.c	2009-09-05 21:33:41.000000000 +0300
@@ -22,6 +22,10 @@ Boston, MA 02110-1301, USA.  */
 #endif

 #include <stdio.h>	/* May get P_tmpdir.  */
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif

Tested by compiling binutils for x86_64-pc-mingw32.  Please apply
to gcc and sourceware.org.  (I don't have write permissions.)

--
Ozkan



More information about the Gcc-patches mailing list