This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]