diff options
author | Bruno Haible <bruno@clisp.org> | 2020-12-07 13:50:53 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-12-07 13:50:53 +0100 |
commit | f08042005f3e70e832c6af9d24e75b75e7df242a (patch) | |
tree | bd06f69793ef642f1b533648b03e362e6781d842 /lib/unistd.in.h | |
parent | c47a68fed2881939f0ebda75c33c809492b9e9ce (diff) | |
download | gnulib-f08042005f3e70e832c6af9d24e75b75e7df242a.tar.gz |
Tweak the Windows oldnames workaround.
Reported by Daniel R. Hurtmans <Daniel.Hurtmans@ulb.ac.be> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00073.html>.
* lib/unistd.in.h: On native Windows, include <io.h> and <direct.h>
always.
(getcwd): Use _GL_CXXALIAS_MDA_CAST.
* lib/stdlib.in.h (putenv): Likewise.
Diffstat (limited to 'lib/unistd.in.h')
-rw-r--r-- | lib/unistd.in.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index c9fb36889a..8a02899f38 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -97,16 +97,9 @@ <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 __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 __CYGWIN__) +#if defined _WIN32 && !defined __CYGWIN__ # include <io.h> +# include <direct.h> #endif /* Native Windows platforms declare _execl*, _execv* in <process.h>. */ @@ -937,7 +930,9 @@ _GL_WARN_ON_USE (getcwd, "getcwd is unportable - " # undef getcwd # define getcwd _getcwd # endif -_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size)); +/* Need to cast, because on mingw, the second parameter is either + 'int size' or 'size_t size'. */ +_GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size)); # else _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size)); # endif |