]> Savannah Git Hosting - gnulib.git/commitdiff
Fix errors in C++ mode on mingw.
authorBruno Haible <bruno@clisp.org>
Sun, 24 Nov 2019 19:12:02 +0000 (20:12 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 24 Nov 2019 19:12:02 +0000 (20:12 +0100)
* 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
lib/arpa_inet.in.h
lib/signal.in.h
lib/spawn.in.h
lib/wchar.in.h

index 573946e02d6415849eb55abef7d53bb7e54e50ea..17907bd958ab5a3da39e58815f3b5d332eeb3d4f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-11-24  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        sys_time: Fix errors in C++ mode on mingw.
index 7a85eacca66a47fc88089482ecab0f143e4dbab6..6722783684049159be11552071796f8785e37a13 100644 (file)
@@ -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
index 0f6486dd6bda8f1b5f3f7a37fced2d03dbcbf21e..b4e432d7fe092cc1ed3874b9534f370388a55e7c 100644 (file)
@@ -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
index 721d70f4b03e037ec147480b7e6583dbc0c7d904..09c66f5adcb01b803ba47617a8ae642ee85a229b 100644 (file)
@@ -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
index 9807f6069aa16db084ca11d6f3ed05cc2c1c1b61..043a592495b15814c3c7d0db23a7e089105b0882 100644 (file)
@@ -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);