From e7e0b673e0dbe830fe1da77d19c94f4699fc68cb Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 18 Mar 2017 00:43:36 +0100 Subject: [PATCH] stat-time, timespec: Support use of the header files in C++ mode. * lib/stat-time.h: Add "C" linkage declaration. * lib/timespec.h: Likewise. --- ChangeLog | 6 ++++++ lib/stat-time.h | 8 ++++++++ lib/timespec.h | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7087aaf5f8..b0529b58dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-03-17 Bruno Haible + + stat-time, timespec: Support use of the header files in C++ mode. + * lib/stat-time.h: Add "C" linkage declaration. + * lib/timespec.h: Likewise. + 2017-03-17 Bruno Haible stdalign: Make it work with HP-UX cc. diff --git a/lib/stat-time.h b/lib/stat-time.h index 9402b3fc1c..47469892ee 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 a5eca797ce..f5d823aefe 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 -- 2.39.5