From c7b1e060d17023065c776757da406d728310cc38 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 20 Jun 2021 17:18:26 +0200 Subject: [PATCH] unistd: Avoid compilation error in C++ mode on Solaris, HP-UX, mingw. Reported by Eli Zaretskii in . * lib/unistd.in.h (swab): Consider different declarations on Solaris, HP-UX, and old mingw. --- ChangeLog | 8 ++++++++ lib/unistd.in.h | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5fc5907aae..eee09cd522 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2021-06-20 Bruno Haible + + unistd: Avoid compilation error in C++ mode on Solaris, HP-UX, mingw. + Reported by Eli Zaretskii in + . + * lib/unistd.in.h (swab): Consider different declarations on Solaris, + HP-UX, and old mingw. + 2021-06-20 Bruno Haible Sync with GNU gettext. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index d4d4ba7743..73c882f97b 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -2034,9 +2034,17 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - " # undef swab # define swab _swab # endif -_GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n)); -# else +/* Need to cast, because in old mingw the arguments are + (const char *from, char *to, size_t n). */ +_GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n)); +# else +# if defined __hpux /* HP-UX */ +_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n)); +# elif defined __sun && !defined _XPG4 /* Solaris */ +_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n)); +# else _GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n)); +# endif # endif _GL_CXXALIASWARN (swab); #endif -- 2.39.5