From: Bruno Haible Date: Mon, 7 Dec 2020 12:50:53 +0000 (+0100) Subject: Tweak the Windows oldnames workaround. X-Git-Tag: v1.0~3406 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f08042005f3e70e832c6af9d24e75b75e7df242a;p=gnulib.git Tweak the Windows oldnames workaround. Reported by Daniel R. Hurtmans in . * lib/unistd.in.h: On native Windows, include and always. (getcwd): Use _GL_CXXALIAS_MDA_CAST. * lib/stdlib.in.h (putenv): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 5f4ae46a6f..6dfedc47f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2020-12-06 Bruno Haible + + Tweak the Windows oldnames workaround. + Reported by Daniel R. Hurtmans in + . + * lib/unistd.in.h: On native Windows, include and + always. + (getcwd): Use _GL_CXXALIAS_MDA_CAST. + * lib/stdlib.in.h (putenv): Likewise. + 2020-12-06 Paul Eggert doc: fix flat address space discussion diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index c7ec0786fb..a76fbdc3d4 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -694,7 +694,9 @@ _GL_CXXALIASWARN (putenv); # undef putenv # define putenv _putenv # endif -_GL_CXXALIAS_MDA (putenv, int, (char *string)); +/* Need to cast, because on mingw, the parameter is either + 'const char *string' or 'char *string'. */ +_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string)); # else _GL_CXXALIAS_SYS (putenv, int, (char *string)); # endif 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 @@ 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 __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 __CYGWIN__) +#if defined _WIN32 && !defined __CYGWIN__ # include +# include #endif /* Native Windows platforms declare _execl*, _execv* in . */ @@ -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