]> Savannah Git Hosting - gnulib.git/commitdiff
unistd: Fix compilation error with MSVC in C++ mode.
authorBruno Haible <bruno@clisp.org>
Sat, 18 May 2024 00:49:02 +0000 (02:49 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 22 May 2024 08:58:35 +0000 (10:58 +0200)
* lib/unistd.in.h (read, write): Use _GL_CXXALIAS_MDA_CAST instead of
_GL_CXXALIAS_MDA.

ChangeLog
lib/unistd.in.h

index 0c0cae47c48b04eca28ded216253def72269bb6e..1f85990c9b5d30260c52a7388cfd81ce6ec3f1b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-17  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        tests: Fix dependencies to test-framework-sh.
index 2ae040a76b3e2a68d413ca1bf15fc3ae889d606a..e93b9cb2208a59b412a4603345747b02cb40cc6c 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2023 Free Software Foundation, Inc.
+   Copyright (C) 2003-2024 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
@@ -1928,11 +1928,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
@@ -2396,11 +2392,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