>From ff66f981a9c19ee7644a55faf873f6ba4e89bdc0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 24 Nov 2019 20:12:02 +0100 Subject: [PATCH 5/5] Fix errors in C++ mode on mingw. * lib/arpa_inet.in.h (inet_ntop, inet_pton): Use _GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS. * lib/signal.in.h (pthread_sigmask): Likewise. * lib/spawn.in.h (posix_spawn_file_actions_addopen, posix_spawn_file_actions_addclose, posix_spawn_file_actions_adddup2): Likewise. * lib/wchar.in.h (btowc): Likewise. --- ChangeLog | 11 +++++++++++ lib/arpa_inet.in.h | 4 ++++ lib/signal.in.h | 2 ++ lib/spawn.in.h | 6 ++++++ lib/wchar.in.h | 3 ++- 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 573946e..17907bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2019-11-24 Bruno Haible + Fix errors in C++ mode on mingw. + * lib/arpa_inet.in.h (inet_ntop, inet_pton): Use _GL_CXXALIAS_SYS_CAST + instead of _GL_CXXALIAS_SYS. + * lib/signal.in.h (pthread_sigmask): Likewise. + * lib/spawn.in.h (posix_spawn_file_actions_addopen, + posix_spawn_file_actions_addclose, posix_spawn_file_actions_adddup2): + Likewise. + * lib/wchar.in.h (btowc): Likewise. + +2019-11-24 Bruno Haible + sys_time: Fix errors in C++ mode on mingw. * lib/sys_time.in.h (timeval): Restore the redirection '#define timeval rpl_timeval', for when the symbol timeval is being used diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h index 7a85eac..6722783 100644 --- a/lib/arpa_inet.in.h +++ b/lib/arpa_inet.in.h @@ -103,7 +103,9 @@ _GL_CXXALIAS_SYS_CAST (inet_ntop, const char *, (int af, const void *restrict src, char *restrict dst, socklen_t cnt)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (inet_ntop); +# endif #elif defined GNULIB_POSIXCHECK # undef inet_ntop # if HAVE_RAW_DECL_INET_NTOP @@ -132,7 +134,9 @@ _GL_FUNCDECL_SYS (inet_pton, int, _GL_CXXALIAS_SYS (inet_pton, int, (int af, const char *restrict src, void *restrict dst)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (inet_pton); +# endif #elif defined GNULIB_POSIXCHECK # undef inet_pton # if HAVE_RAW_DECL_INET_PTON diff --git a/lib/signal.in.h b/lib/signal.in.h index 0f6486d..b4e432d 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -144,7 +144,9 @@ _GL_FUNCDECL_SYS (pthread_sigmask, int, _GL_CXXALIAS_SYS (pthread_sigmask, int, (int how, const sigset_t *new_mask, sigset_t *old_mask)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (pthread_sigmask); +# endif #elif defined GNULIB_POSIXCHECK # undef pthread_sigmask # if HAVE_RAW_DECL_PTHREAD_SIGMASK diff --git a/lib/spawn.in.h b/lib/spawn.in.h index 721d70f..09c66f5 100644 --- a/lib/spawn.in.h +++ b/lib/spawn.in.h @@ -802,7 +802,9 @@ _GL_CXXALIAS_SYS (posix_spawn_file_actions_addopen, int, int __fd, const char *_Restrict_ __path, int __oflag, mode_t __mode)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (posix_spawn_file_actions_addopen); +# endif #elif defined GNULIB_POSIXCHECK # undef posix_spawn_file_actions_addopen # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN @@ -833,7 +835,9 @@ _GL_FUNCDECL_SYS (posix_spawn_file_actions_addclose, int, _GL_CXXALIAS_SYS (posix_spawn_file_actions_addclose, int, (posix_spawn_file_actions_t *__file_actions, int __fd)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (posix_spawn_file_actions_addclose); +# endif #elif defined GNULIB_POSIXCHECK # undef posix_spawn_file_actions_addclose # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE @@ -868,7 +872,9 @@ _GL_CXXALIAS_SYS (posix_spawn_file_actions_adddup2, int, (posix_spawn_file_actions_t *__file_actions, int __fd, int __newfd)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (posix_spawn_file_actions_adddup2); +# endif #elif defined GNULIB_POSIXCHECK # undef posix_spawn_file_actions_adddup2 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 9807f60..043a592 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -161,7 +161,8 @@ _GL_CXXALIAS_RPL (btowc, wint_t, (int c)); # if !@HAVE_BTOWC@ _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); # endif -_GL_CXXALIAS_SYS (btowc, wint_t, (int c)); +/* Need to cast, because on mingw, the return type is 'unsigned short'. */ +_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c)); # endif # if __GLIBC__ >= 2 _GL_CXXALIASWARN (btowc); -- 2.7.4