bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stat-time, timespec: support use in C++


From: Bruno Haible
Subject: stat-time, timespec: support use in C++
Date: Sat, 18 Mar 2017 00:44:06 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-66-generic; KDE/5.18.0; x86_64; ; )

Trivial change, to make these modules usable in C++ mode.


2017-03-17  Bruno Haible  <address@hidden>

        stat-time, timespec: Support use of the header files in C++ mode.
        * lib/stat-time.h: Add "C" linkage declaration.
        * lib/timespec.h: Likewise.

diff --git a/ChangeLog b/ChangeLog
index 7087aaf..b0529b5 100644
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 9402b3f..4746989 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -31,6 +31,10 @@ _GL_INLINE_HEADER_BEGIN
 # define _GL_STAT_TIME_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
    struct timespec, if available.  If not, then STAT_TIMESPEC_NS (ST,
    ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
@@ -194,6 +198,10 @@ get_stat_birthtime (struct stat const *st)
   return t;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif
diff --git a/lib/timespec.h b/lib/timespec.h
index a5eca79..f5d823a 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -29,6 +29,10 @@ _GL_INLINE_HEADER_BEGIN
 # define _GL_TIMESPEC_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Resolution of timespec timestamps (in units per second), and log
    base 10 of the resolution.  */
 
@@ -107,6 +111,10 @@ timespectod (struct timespec a)
 void gettime (struct timespec *);
 int settime (struct timespec const *);
 
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]