From c42fbc9449623ebd41158c5bda0dba6ced057cf7 Mon Sep 17 00:00:00 2001
From: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Date: Mon, 8 Oct 2012 22:47:24 +0200
Subject: [PATCH] gethrxtime: make C++ safe

* lib/gethrxtime.h, lib/xtime.h [__cplusplus]: Add extern "C".
---
 lib/gethrxtime.h |    8 ++++++++
 lib/xtime.h      |    8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/lib/gethrxtime.h b/lib/gethrxtime.h
index f09ef39..9453d60 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 adab518..3d235fa 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
-- 
1.7.10.4

