bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] random_r: new module


From: Simon Josefsson
Subject: Re: [PATCH] random_r: new module
Date: Fri, 24 Oct 2008 10:19:37 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Bruno Haible <address@hidden> writes:

> If you put a #include inside an extern "C" { ... } block, like this, it yields
> a syntax error in C++ mode on some platforms. Better put the #include
> before the extern "C" block, like this:

Ah, that's useful information to document somewhere.  I pushed the patch
below.  Do you know which platforms are affected in this way?

/Simon

>From aa087a665ac755fb932610ba6ade2e7af7aeff9d Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Fri, 24 Oct 2008 10:18:39 +0200
Subject: [PATCH] doc/gnulib.texi (Header files): Add note about C++ problems.

---
 ChangeLog       |    5 +++++
 doc/gnulib.texi |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cd514df..c32c1eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-24  Simon Josefsson  <address@hidden>
+
+       * doc/gnulib.texi (Header files): Add note about C++ problems.
+       Explained by Bruno Haible <address@hidden>.
+
 2008-10-23  Bruno Haible  <address@hidden>
 
        Define a dummy SA_NODEFER macro on Interix.
diff --git a/doc/gnulib.texi b/doc/gnulib.texi
index e4f0bed..e98f124 100644
--- a/doc/gnulib.texi
+++ b/doc/gnulib.texi
@@ -199,6 +199,11 @@ preference might depend on whether you consider the API 
exported by
 your header file as something available for C programs only, or for C
 and C++ programs alike.
 
+Note that putting a @code{#include} in an @code{extern "C" @{ ... @}}
+block yields a syntax error in C++ mode on some platforms.  For this
+reason, it is recommended to place the @code{#include} before the
address@hidden "C"} block.
+
 @subheading Include ordering
 
 When writing a gnulib module, or even in general, a good way to order
-- 
1.5.6.5





reply via email to

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