gethrxtime: port to C++
authorAlexandre Duret-Lutz <adl@lrde.epita.fr>
Mon, 8 Oct 2012 21:46:18 +0000 (14:46 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 8 Oct 2012 21:46:47 +0000 (14:46 -0700)
* lib/gethrxtime.h, lib/xtime.h [__cplusplus]: Add extern "C".

ChangeLog
lib/gethrxtime.h
lib/xtime.h

index 8f4929c..0a102bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-08  Alexandre Duret-Lutz  <adl@lrde.epita.fr>  (tiny change)
+
+       gethrxtime: port to C++
+       * lib/gethrxtime.h, lib/xtime.h [__cplusplus]: Add extern "C".
+
 2012-10-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        ptsname: fix macro-name typo
index f09ef39..9453d60 100644 (file)
 
 # 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
index adab518..3d235fa 100644 (file)
@@ -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