bug-gnulib
[Top][All Lists]
Advanced

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

Re: gettimeofday does not link with g++


From: Simon Josefsson
Subject: Re: gettimeofday does not link with g++
Date: Fri, 28 Nov 2008 15:36:34 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

Brian Dessent <address@hidden> writes:

>> any ideas?
>
> It looks like lib/sys_time.in.h needs the same 'extern "C"' treatment.

I pushed this.

/Simon

>From 19f2f429543482797a238618a51be114d6f11483 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Fri, 28 Nov 2008 15:33:48 +0100
Subject: [PATCH] sys_time: Add extern "C" block for C++.

---
 ChangeLog         |    6 ++++++
 lib/sys_time.in.h |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index daa90b2..583e4cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-28  Simon Josefsson  <address@hidden>
+
+       * lib/sys_time.in.h: Add extern "C" block for C++.  Suggested by
+       Brian Dessent <address@hidden>.  Reported by Sam Steingold
+       <address@hidden>.
+
 2008-11-20  Bruno Haible  <address@hidden>
 
        Attempt to work around an AIX 5.3, 6.1 compiler bug with include_next.
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index 439d3bb..d9fb361 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -39,6 +39,10 @@
 #  include <time.h>
 # endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 # if ! @HAVE_STRUCT_TIMEVAL@
 struct timeval
 {
@@ -53,4 +57,8 @@ struct timeval
 int gettimeofday (struct timeval *restrict, void *restrict);
 # endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_SYS_TIME_H */
-- 
1.5.6.5






reply via email to

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