From 38237baf99386101934cd93278023aa4ae523ec0 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 15 Nov 2016 02:36:00 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ lib/sys_time.in.h | 7 +++++++ 2 files changed, 14 insertions(+) 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 -- 2.39.5