From: Bruno Haible Date: Thu, 21 Nov 2019 10:44:10 +0000 (+0100) Subject: Fix various errors in _GL_CXXALIAS_SYS invocations. X-Git-Tag: v1.0~4584 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=5652992e666d0cdcf89112d5c212c1792514402e;p=gnulib.git 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'. --- diff --git a/ChangeLog b/ChangeLog index 0a7006ce23..1c60182584 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 97479db32f..efc29b40a8 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 9c0a422342..3a379d0780 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 e5583d967c..96c48fed40 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 bc67bcf35b..e264257daf 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 19ee961744..5bcee9e873 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 90dbfeeb86..2fa25b4a75 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