bug-gnulib
[Top][All Lists]
Advanced

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

Re: extern "C" for strftime.h?


From: Jim Meyering
Subject: Re: extern "C" for strftime.h?
Date: Sat, 14 Nov 2009 08:25:44 +0100

John W. Eaton wrote:
> Is there any reason that the strftime.h header in gnulib does not use
> extern "C"?  If not, then would the following patch be OK?

No one asked for it.
I've pushed this:

>From ee8909a98bbfffc6317e1e9273e1cb8d6341ea25 Mon Sep 17 00:00:00 2001
From: John W. Eaton <address@hidden>
Date: Sat, 14 Nov 2009 08:24:25 +0100
Subject: [PATCH] strftime.h: wrap funtion declaration in extern "C" block

* lib/strftime.h (nstrftime) [__cplusplus]: Wrap declaration.
---
 ChangeLog      |    5 +++++
 lib/strftime.h |    8 ++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fdb892b..e23f285 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-14  John W. Eaton  <address@hidden>
+
+       strftime.h: wrap funtion declaration in extern "C" block
+       * lib/strftime.h (nstrftime) [__cplusplus]: Wrap declaration.
+
 2009-11-13  Eric Blake  <address@hidden>

        getgroups: avoid compiler warning
diff --git a/lib/strftime.h b/lib/strftime.h
index c3c183e..1937d40 100644
--- a/lib/strftime.h
+++ b/lib/strftime.h
@@ -17,6 +17,10 @@

 #include <time.h>

+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Just like strftime, but with two more arguments:
    POSIX requires that strftime use the local timezone information.
    When __UTC is nonzero and tm->tm_zone is NULL or the empty string,
@@ -24,3 +28,7 @@
    %N directive.  */
 size_t nstrftime (char *, size_t, char const *, struct tm const *,
                  int __utc, int __ns);
+
+#ifdef __cplusplus
+}
+#endif
--
1.6.5.2.372.gc0502




reply via email to

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