summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2012-01-15 17:35:55 +0100
committerBruno Haible <bruno@clisp.org>2012-01-15 17:50:27 +0100
commita9097796ff31942ab21b990723569493615f0fa6 (patch)
tree71ecb4aa36eca19215761e70473038656cc8cfa0 /lib
parentf8b71202829f27d6fdb306cdecf28608a726b0d6 (diff)
downloadgnulib-a9097796ff31942ab21b990723569493615f0fa6.tar.gz
Improve support for MSVC 9.
* lib/unistd.in.h: Include <io.h> when needed to avoid redefinition clashes on MSVC. * lib/fcntl.in.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/sys_stat.in.h: Likewise.
Diffstat (limited to 'lib')
-rw-r--r--lib/fcntl.in.h6
-rw-r--r--lib/stdlib.in.h5
-rw-r--r--lib/sys_stat.in.h5
-rw-r--r--lib/unistd.in.h9
4 files changed, 24 insertions, 1 deletions
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 84ae3eeaa1..344bbe4d3d 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -62,6 +62,12 @@
# include <unistd.h>
#endif
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index c25ce0e69a..e92a614cc2 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -49,6 +49,11 @@
# include <sys/loadavg.h>
#endif
+/* Native Windows platforms declare mktemp() in <io.h>. */
+#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
#if @GNULIB_RANDOM_R@
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 045cb18b9e..005ad2de34 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -62,6 +62,11 @@
# include <direct.h> /* mingw64, MSVC 9 */
#endif
+/* Native Windows platforms declare umask() in <io.h>. */
+#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
#ifndef S_IFIFO
# ifdef _S_IFIFO
# define S_IFIFO _S_IFIFO
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index c579cd46b6..811a67b3ec 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -84,12 +84,19 @@
#endif
/* Native Windows platforms declare chdir, getcwd, rmdir in
- <io.h> and/or <direct.h>, not in <unistd.h>. */
+ <io.h> and/or <direct.h>, not in <unistd.h>.
+ They also declare access(), chmod(), close(), dup(), dup2(), isatty(),
+ lseek(), read(), unlink(), write() in <io.h>. */
#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
|| defined GNULIB_POSIXCHECK) \
&& ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
# include <io.h> /* mingw32, mingw64 */
# include <direct.h> /* mingw64, MSVC 9 */
+#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
+ || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
+ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
#endif
/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.