From: Pedro Alves Date: Tue, 15 Nov 2016 02:36:00 +0000 (+0000) Subject: sys_time: add gnulib::timeval for C++ X-Git-Tag: v1.0~6551 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=38237baf99386101934cd93278023aa4ae523ec0;p=gnulib.git sys_time: add gnulib::timeval for C++ * lib/sys_time.in.h [__cplusplus && defined GNULIB_NAMESPACE]: Define "timeval" in the GNULIB_NAMESPACE namespace, and #undef any timeval macro. --- diff --git a/ChangeLog b/ChangeLog index e0490bd523..c0851b2bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-11-15 Pedro Alves + + sys_time: add gnulib::timeval for C++ + * lib/sys_time.in.h [__cplusplus && defined GNULIB_NAMESPACE]: + Define "timeval" in the GNULIB_NAMESPACE namespace, and #undef any + timeval macro. + 2016-11-14 Pedro Alves snippet/c++defs: fix real-floating arg functions in C++ mode diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h index 4dc0cc4066..d3adf586b1 100644 --- a/lib/sys_time.in.h +++ b/lib/sys_time.in.h @@ -109,6 +109,13 @@ _GL_CXXALIAS_SYS_CAST (gettimeofday, int, (struct timeval *restrict, void *restrict)); # endif _GL_CXXALIASWARN (gettimeofday); +# if defined __cplusplus && defined GNULIB_NAMESPACE +namespace GNULIB_NAMESPACE { + typedef ::timeval +#undef timeval + timeval; +} +# endif #elif defined GNULIB_POSIXCHECK # undef gettimeofday # if HAVE_RAW_DECL_GETTIMEOFDAY