From a9097796ff31942ab21b990723569493615f0fa6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 15 Jan 2012 17:35:55 +0100 Subject: [PATCH] Improve support for MSVC 9. * lib/unistd.in.h: Include when needed to avoid redefinition clashes on MSVC. * lib/fcntl.in.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/sys_stat.in.h: Likewise. --- ChangeLog | 9 +++++++++ lib/fcntl.in.h | 6 ++++++ lib/stdlib.in.h | 5 +++++ lib/sys_stat.in.h | 5 +++++ lib/unistd.in.h | 9 ++++++++- 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8b82eedca..1e296b455 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-01-15 Bruno Haible + + Improve support for MSVC 9. + * lib/unistd.in.h: Include when needed to avoid redefinition + clashes on MSVC. + * lib/fcntl.in.h: Likewise. + * lib/stdlib.in.h: Likewise. + * lib/sys_stat.in.h: Likewise. + 2011-01-15 Stefano Lattarini gnupload: we hold the master copy of this script now diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 84ae3eeaa..344bbe4d3 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -62,6 +62,12 @@ # include #endif +/* Native Windows platforms declare open(), creat() in . */ +#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index c25ce0e69..e92a614cc 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -49,6 +49,11 @@ # include #endif +/* Native Windows platforms declare mktemp() in . */ +#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include +#endif + #if @GNULIB_RANDOM_R@ /* OSF/1 5.1 declares 'struct random_data' in , which is included diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index 045cb18b9..005ad2de3 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -62,6 +62,11 @@ # include /* mingw64, MSVC 9 */ #endif +/* Native Windows platforms declare umask() in . */ +#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include +#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 c579cd46b..811a67b3e 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -84,12 +84,19 @@ #endif /* Native Windows platforms declare chdir, getcwd, rmdir in - and/or , not in . */ + and/or , not in . + They also declare access(), chmod(), close(), dup(), dup2(), isatty(), + lseek(), read(), unlink(), write() in . */ #if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \ || defined GNULIB_POSIXCHECK) \ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) # include /* mingw32, mingw64 */ # include /* 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 #endif /* AIX and OSF/1 5.1 declare getdomainname in , not in . -- 2.11.0