]> Savannah Git Hosting - gnulib.git/commitdiff
Fix various errors in _GL_CXXALIAS_SYS invocations.
authorBruno Haible <bruno@clisp.org>
Thu, 21 Nov 2019 10:44:10 +0000 (11:44 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 21 Nov 2019 10:44:10 +0000 (11:44 +0100)
* lib/locale.in.h (freelocale): Use _GL_CXXALIAS_SYS_CAST instead of
_GL_CXXALIAS_SYS.
* lib/pthread.in.h (pthread_mutexattr_gettype,
pthread_mutexattr_getrobust): Likewise.
* lib/stdlib.in.h (srandom, initstate, setstate): Likewise.
* lib/sys_socket.in.h (recv, send): Likewise.
* lib/unistd.in.h (getdtablesize): Likewise.
* lib/sys_select.in.h (select): In C++, write 'timeval' instead of
'struct timeval'.

ChangeLog
lib/locale.in.h
lib/pthread.in.h
lib/stdlib.in.h
lib/sys_select.in.h
lib/sys_socket.in.h
lib/unistd.in.h

index 0a7006ce23a32b65fe5b7d1ebc1f92dd3ee1cc8c..1c601825849be097ed4f4bd55b8d915c06f34b3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2019-11-21  Bruno Haible  <bruno@clisp.org>
+
+       Fix various errors in _GL_CXXALIAS_SYS invocations.
+       * lib/locale.in.h (freelocale): Use _GL_CXXALIAS_SYS_CAST instead of
+       _GL_CXXALIAS_SYS.
+       * lib/pthread.in.h (pthread_mutexattr_gettype,
+       pthread_mutexattr_getrobust): Likewise.
+       * lib/stdlib.in.h (srandom, initstate, setstate): Likewise.
+       * lib/sys_socket.in.h (recv, send): Likewise.
+       * lib/unistd.in.h (getdtablesize): Likewise.
+       * lib/sys_select.in.h (select): In C++, write 'timeval' instead of
+       'struct timeval'.
+
 2019-11-21  Bruno Haible  <bruno@clisp.org>
 
        math tests: Update after 2019-08-28 change.
index 97479db32fa53234fde84bfd5c101fb7d0235584..efc29b40a89301a2da0aeb477f4b55085dc147ca 100644 (file)
@@ -254,7 +254,9 @@ _GL_FUNCDECL_RPL (freelocale, void, (locale_t locale) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
 # else
 #  if @HAVE_FREELOCALE@
-_GL_CXXALIAS_SYS (freelocale, void, (locale_t locale));
+/* Need to cast, because on FreeBSD and Mac OS X 10.13, the return type is
+                                   int.  */
+_GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale));
 #  endif
 # endif
 # if @HAVE_FREELOCALE@
index 9c0a422342bc0c363009c57599c66797795734ba..3a379d07803f22692c770fd19598abefcff8083f 100644 (file)
@@ -804,8 +804,10 @@ _GL_FUNCDECL_SYS (pthread_mutexattr_gettype, int,
                   (const pthread_mutexattr_t *attr, int *typep)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
-_GL_CXXALIAS_SYS (pthread_mutexattr_gettype, int,
-                  (const pthread_mutexattr_t *attr, int *typep));
+/* Need to cast, because on FreeBSD the first parameter is
+                        pthread_mutexattr_t *attr.  */
+_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_gettype, int,
+                       (const pthread_mutexattr_t *attr, int *typep));
 # endif
 _GL_CXXALIASWARN (pthread_mutexattr_gettype);
 #elif defined GNULIB_POSIXCHECK
@@ -860,8 +862,10 @@ _GL_FUNCDECL_SYS (pthread_mutexattr_getrobust, int,
                   (const pthread_mutexattr_t *attr, int *robustp)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
-_GL_CXXALIAS_SYS (pthread_mutexattr_getrobust, int,
-                  (const pthread_mutexattr_t *attr, int *robustp));
+/* Need to cast, because on FreeBSD the first parameter is
+                        pthread_mutexattr_t *attr.  */
+_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_getrobust, int,
+                       (const pthread_mutexattr_t *attr, int *robustp));
 # endif
 _GL_CXXALIASWARN (pthread_mutexattr_getrobust);
 #elif defined GNULIB_POSIXCHECK
index e5583d967c12d9fa38d9ab8ae5bfc552fb6e361a..96c48fed40e21be7426c19a919af4abcf4a2f50a 100644 (file)
@@ -616,7 +616,9 @@ _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
 #  if !@HAVE_RANDOM@
 _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
 #  endif
-_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
+/* Need to cast, because on FreeBSD, the first parameter is
+                                       unsigned long seed.  */
+_GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
 # endif
 _GL_CXXALIASWARN (srandom);
 #elif defined GNULIB_POSIXCHECK
@@ -644,8 +646,10 @@ _GL_FUNCDECL_SYS (initstate, char *,
                   (unsigned int seed, char *buf, size_t buf_size)
                   _GL_ARG_NONNULL ((2)));
 #  endif
-_GL_CXXALIAS_SYS (initstate, char *,
-                  (unsigned int seed, char *buf, size_t buf_size));
+/* Need to cast, because on FreeBSD, the first parameter is
+                        unsigned long seed.  */
+_GL_CXXALIAS_SYS_CAST (initstate, char *,
+                       (unsigned int seed, char *buf, size_t buf_size));
 # endif
 _GL_CXXALIASWARN (initstate);
 #elif defined GNULIB_POSIXCHECK
@@ -668,7 +672,9 @@ _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
 #  if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
 _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
 #  endif
-_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
+/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
+   is                                     const char *arg_state.  */
+_GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
 # endif
 _GL_CXXALIASWARN (setstate);
 #elif defined GNULIB_POSIXCHECK
index bc67bcf35b161fafc4071c3de7531f78ba03d550..e264257daf9a903ac8e964feefa16459e798d52f 100644 (file)
@@ -299,7 +299,7 @@ _GL_CXXALIAS_RPL (select, int,
 # else
 _GL_CXXALIAS_SYS (select, int,
                   (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
-                   struct timeval *restrict));
+                   timeval *restrict));
 # endif
 _GL_CXXALIASWARN (select);
 #elif @HAVE_WINSOCK2_H@
index 19ee9617443ac53d36aac5e2c75d41c07fc7c7c4..5bcee9e873b95c0fe5a247d65c24490f6f58d616 100644 (file)
@@ -517,7 +517,10 @@ _GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
                                  _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
 # else
-_GL_CXXALIAS_SYS (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+/* Need to cast, because on HP-UX 11.31 the return type may be
+                             int,
+   depending on compiler options.  */
+_GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
 # endif
 _GL_CXXALIASWARN (recv);
 #elif @HAVE_WINSOCK2_H@
@@ -543,8 +546,11 @@ _GL_FUNCDECL_RPL (send, ssize_t,
 _GL_CXXALIAS_RPL (send, ssize_t,
                   (int fd, const void *buf, size_t len, int flags));
 # else
-_GL_CXXALIAS_SYS (send, ssize_t,
-                  (int fd, const void *buf, size_t len, int flags));
+/* Need to cast, because on HP-UX 11.31 the return type may be
+                             int,
+   depending on compiler options.  */
+_GL_CXXALIAS_SYS_CAST (send, ssize_t,
+                       (int fd, const void *buf, size_t len, int flags));
 # endif
 _GL_CXXALIASWARN (send);
 #elif @HAVE_WINSOCK2_H@
index 90dbfeeb86157b59af90c6c1d9f2dc88464b0710..2fa25b4a7534ada5661d008ad1d74b7df624e2bb 100644 (file)
@@ -749,7 +749,9 @@ _GL_CXXALIAS_RPL (getdtablesize, int, (void));
 #  if !@HAVE_GETDTABLESIZE@
 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
 #  endif
-_GL_CXXALIAS_SYS (getdtablesize, int, (void));
+/* Need to cast, because on AIX, the parameter list is
+                                           (...).  */
+_GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void));
 # endif
 _GL_CXXALIASWARN (getdtablesize);
 #elif defined GNULIB_POSIXCHECK