>From 2ef87ea7645564d65b1d747acb8da4b190def644 Mon Sep 17 00:00:00 2001 From: Bruno Haible Subject: [PATCH 4/5] 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'. --- ChangeLog | 13 +++++++++++++ lib/locale.in.h | 4 +++- lib/pthread.in.h | 12 ++++++++---- lib/stdlib.in.h | 14 ++++++++++---- lib/sys_select.in.h | 2 +- lib/sys_socket.in.h | 12 +++++++++--- lib/unistd.in.h | 4 +++- 7 files changed, 47 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index f60daa0..6a84116 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2019-11-21 Bruno Haible + + 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 math tests: Update after 2019-08-28 change. diff --git a/lib/locale.in.h b/lib/locale.in.h index 97479db..efc29b4 100644 --- a/lib/locale.in.h +++ b/lib/locale.in.h @@ -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@ diff --git a/lib/pthread.in.h b/lib/pthread.in.h index 9c0a422..3a379d0 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -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 diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index e5583d9..96c48fe 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -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 diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index bc67bcf..e264257 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -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@ diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index 19ee961..5bcee9e 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -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@ diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 90dbfee..2fa25b4 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -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 -- 2.7.4