>From df8452e776ee1e1374c4358d5df4c4f8e8440418 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 24 Nov 2019 20:11:28 +0100 Subject: [PATCH 4/5] 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 outside the 'gnulib' namespace. * lib/sys_select.in.h (select): In C++, write 'timeval', not 'struct timeval'. --- ChangeLog | 9 +++++++++ lib/sys_select.in.h | 2 +- lib/sys_time.in.h | 6 +++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 356edcb..573946e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 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 + outside the 'gnulib' namespace. + * lib/sys_select.in.h (select): In C++, write 'timeval', not + 'struct timeval'. + +2019-11-24 Bruno Haible + iswctype: Fix errors in C++ mode on mingw. * lib/wctype.in.h (rpl_iswctype): Override if GNULIB_OVERRIDES_WINT_T is 1. diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index e264257..19205cb 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -295,7 +295,7 @@ _GL_FUNCDECL_RPL (select, int, struct timeval *restrict)); _GL_CXXALIAS_RPL (select, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, - struct timeval *restrict)); + timeval *restrict)); # else _GL_CXXALIAS_SYS (select, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h index 2bc2bb3..6859af3 100644 --- a/lib/sys_time.in.h +++ b/lib/sys_time.in.h @@ -112,8 +112,12 @@ _GL_CXXALIASWARN (gettimeofday); # if defined __cplusplus && defined GNULIB_NAMESPACE namespace GNULIB_NAMESPACE { typedef ::timeval -#undef timeval +# undef timeval timeval; +# if @REPLACE_STRUCT_TIMEVAL@ +# define timeval rpl_timeval + typedef ::timeval timeval; +# endif } # endif #elif defined GNULIB_POSIXCHECK -- 2.7.4