Hello,
this patch fixes a linker problem when the file is used with C++,
forcing a C linkage. I got this problem under mingw.
Also, I could not use extern "C" around <fts_.h> because it breaks
verify.h:
In file included from ../lib/i-ring.h:18,
from ../lib/fts_.h:66:
../lib/verify.h:147: error: template with C linkage
Cheers,
Giuseppe
>From 7cf0da716e9283b2a77d714e73df735702edbef2 Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <[email protected]>
Date: Sun, 22 Aug 2010 02:18:31 +0200
Subject: [PATCH] fts: allow compilation with C++
* lib/fts_.h: Specify extern "C" linkage with C++.
---
ChangeLog | 5 +++++
lib/fts_.h | 9 +++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 20a5adc..d7943d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-22 Giuseppe Scrivano <[email protected]>
+
+ fts: allow compilation with C++
+ * lib/fts_.h: Specify extern "C" linkage with C++.
+
2010-08-17 Eric Blake <[email protected]>
test-stddef: test for (some) offsetof bugs
diff --git a/lib/fts_.h b/lib/fts_.h
index 75324d4..1d532b4 100644
--- a/lib/fts_.h
+++ b/lib/fts_.h
@@ -55,9 +55,14 @@
# undef __THROW
# define __THROW
# undef __BEGIN_DECLS
-# define __BEGIN_DECLS
# undef __END_DECLS
-# define __END_DECLS
+# ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+# else
+# define __BEGIN_DECLS
+# define __END_DECLS
+# endif
# endif
# include <stddef.h>
--
1.7.1