From: Bruno Haible Date: Sun, 24 Nov 2019 19:11:28 +0000 (+0100) Subject: sys_time: Fix errors in C++ mode on mingw. X-Git-Tag: v1.0~4574 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=df8452e776ee1e1374c4358d5df4c4f8e8440418;p=gnulib.git 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'. --- diff --git a/ChangeLog b/ChangeLog index 356edcbb83..573946e02d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +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. diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index e264257daf..19205cba2e 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 2bc2bb3b2f..6859af39de 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