From 7c46ff1b6e2be624841ac9320a63be0631c7c609 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin
Date: Mon, 6 Dec 2021 04:25:44 +0100
Subject: [PATCH] Add "cxxheader" section to allow injecting extra C++
declarations
This can also be used to include extra C++ headers.
Document this section as well as the already existing "cheader" one.
---
Doc/Manual/C.html | 12 ++++++++++++
Source/Modules/c.cxx | 11 ++++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/Doc/Manual/C.html b/Doc/Manual/C.html
index eb9089d0c..a31329200 100644
--- a/Doc/Manual/C.html
+++ b/Doc/Manual/C.html
@@ -199,6 +199,15 @@ This will compile the application code (runme.c) and link it against th
Wrapping C functions and variables is obviously performed in a straightforward way. There is no need to perform type conversions, and all language constructs can be preserved in their original form. However, SWIG allows you to enhance the code with some additional elements, for instance using check typemap or %extend directive.
+
+It is also possible to output arbitrary additional code into the generated header by using %insert directive with cheader section, e.g.
+
+%insert("cheader") %{
+#include "another.h"
+%}
+
+
+
36.3.1 Functions
@@ -668,5 +677,8 @@ Other ones are due to things that could be supported but haven't been implemente
+Note that cxxheader section can be used to output additional
+declarations to the C++-only part of the generated header.
+