From 9eae45336caf379a72fd34b2b4a71fa07ce8cfea Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 18 May 2024 02:49:02 +0200 Subject: [PATCH] unistd: Fix compilation error with MSVC in C++ mode. * lib/unistd.in.h (read, write): Use _GL_CXXALIAS_MDA_CAST instead of _GL_CXXALIAS_MDA. --- ChangeLog | 6 ++++++ lib/unistd.in.h | 12 ++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 535d7ba382..888ab7fdd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-05-17 Bruno Haible + + unistd: Fix compilation error with MSVC in C++ mode. + * lib/unistd.in.h (read, write): Use _GL_CXXALIAS_MDA_CAST instead of + _GL_CXXALIAS_MDA. + 2024-05-17 Bruno Haible stdbit-h: Fix compilation error with MSVC in C++ mode. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index fa99d7472f..7dbed38969 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1934,11 +1934,7 @@ _GL_CXXALIASWARN (read); # undef read # define read _read # endif -# ifdef __MINGW32__ -_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count)); -# else -_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count)); -# endif +_GL_CXXALIAS_MDA_CAST (read, ssize_t, (int fd, void *buf, unsigned int count)); # else _GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); # endif @@ -2402,11 +2398,7 @@ _GL_CXXALIASWARN (write); # undef write # define write _write # endif -# ifdef __MINGW32__ -_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count)); -# else -_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count)); -# endif +_GL_CXXALIAS_MDA_CAST (write, ssize_t, (int fd, const void *buf, unsigned int count)); # else _GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); # endif -- 2.39.5