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.
This commit is contained in:
Vadim Zeitlin 2021-12-06 04:25:44 +01:00
commit 7c46ff1b6e
2 changed files with 22 additions and 1 deletions

View file

@ -199,6 +199,15 @@ This will compile the application code (<tt>runme.c</tt>) 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 <tt>check</tt> typemap or <tt>%extend</tt> directive.
</p>
<p>
It is also possible to output arbitrary additional code into the generated header by using <tt>%insert</tt> directive with <tt>cheader</tt> section, e.g.
<div class="code"><pre>
%insert("cheader") %{
#include "another.h"
%}
</pre></div>
</p>
<H3><a name="C_functions"></a>36.3.1 Functions</H3>
@ -668,5 +677,8 @@ Other ones are due to things that could be supported but haven't been implemente
</ul>
</p>
Note that <tt>cxxheader</tt> section can be used to output additional
declarations to the C++-only part of the generated header.
</body>
</html>