Bruno Haible <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
+
+ * doc/gnulib.texi (Header files): Add note about C++ problems.
+ Explained by Bruno Haible <[EMAIL PROTECTED]>.
+
2008-10-23 Bruno Haible <[EMAIL PROTECTED]>
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
[EMAIL PROTECTED] "C"} block.
+
@subheading Include ordering
When writing a gnulib module, or even in general, a good way to order
--
1.5.6.5