From 0b95481ce5bd62e3150f0e94a1e3ce3a38fc5b0a Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 8 Oct 2012 14:46:18 -0700 Subject: [PATCH] gethrxtime: port to C++ * lib/gethrxtime.h, lib/xtime.h [__cplusplus]: Add extern "C". --- ChangeLog | 5 +++++ lib/gethrxtime.h | 8 ++++++++ lib/xtime.h | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8f4929cce..0a102bc5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-10-08 Alexandre Duret-Lutz (tiny change) + + gethrxtime: port to C++ + * lib/gethrxtime.h, lib/xtime.h [__cplusplus]: Add extern "C". + 2012-10-04 Paul Eggert ptsname: fix macro-name typo diff --git a/lib/gethrxtime.h b/lib/gethrxtime.h index f09ef39c3..9453d609e 100644 --- a/lib/gethrxtime.h +++ b/lib/gethrxtime.h @@ -22,6 +22,10 @@ # include "xtime.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Get the current time, as a count of the number of nanoseconds since an arbitrary epoch (e.g., the system boot time). Prefer a high-resolution clock that is not subject to resetting or @@ -34,4 +38,8 @@ static inline xtime_t gethrxtime (void) { return gethrtime (); } xtime_t gethrxtime (void); # endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/xtime.h b/lib/xtime.h index adab518b1..3d235faba 100644 --- a/lib/xtime.h +++ b/lib/xtime.h @@ -37,6 +37,10 @@ typedef long int xtime_t; # endif # endif +#ifdef __cplusplus +extern "C" { +#endif + /* Return an extended time value that contains S seconds and NS nanoseconds, without any overflow checking. */ static inline xtime_t @@ -83,4 +87,8 @@ xtime_nsec (xtime_t t) return ns; } +#ifdef __cplusplus +} +#endif + #endif -- 2.11.0