I am going to use gnulib in a C++ program.  This is the first problem I
encountered.

Cheers,
Giuseppe


>From 27c9d4725bfb95915c98644e12f5e5d7818a19aa Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <gscriv...@gnu.org>
Date: Mon, 19 Oct 2009 01:56:20 +0200
Subject: [PATCH] Fix a linker error when used by a C++ program.

* lib/nproc.h: Add extern "C" block for C++.
---
 lib/nproc.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/nproc.h b/lib/nproc.h
index fe5b57e..4a8b4d4 100644
--- a/lib/nproc.h
+++ b/lib/nproc.h
@@ -18,4 +18,13 @@
 
 /* Written by Glen Lenker.  */
 
+/* Allow the use in C++ code.  */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 unsigned long int num_processors (void);
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
-- 
1.6.3.3


Reply via email to