bug-gnulib
[Top][All Lists]
Advanced

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

Fix a linker error when used by a C++ program


From: Giuseppe Scrivano
Subject: Fix a linker error when used by a C++ program
Date: Mon, 19 Oct 2009 02:07:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

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 <address@hidden>
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

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