From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sun, 22 Aug 2010 14:20:42 +0000 (-0400)
Subject: fts: allow compilation with C++
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06728e052e6522623d9b38a264cf488e75bb5e0c;p=pspp

fts: allow compilation with C++

* lib/fts_.h: Specify extern "C" linkage with C++.
---

diff --git a/ChangeLog b/ChangeLog
index b540fd196f..1337347344 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-22  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+	fts: allow compilation with C++
+	* lib/fts_.h: Specify extern "C" linkage with C++.
+
 2010-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	Fix gnulib-tool sed script de-commentation for AIX sed.
diff --git a/lib/fts_.h b/lib/fts_.h
index 75324d42df..1d532b474a 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>