Make docs on c++ source files more technically correct and fix some html errors
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11791 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d1ff2c6a8b
commit
f755bf73bf
1 changed files with 18 additions and 12 deletions
|
|
@ -330,11 +330,13 @@ currently supported:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Non-conventional type declarations.
|
<li>
|
||||||
|
<p>
|
||||||
|
Non-conventional type declarations.
|
||||||
For example, SWIG does not support declarations such as the following
|
For example, SWIG does not support declarations such as the following
|
||||||
(even though this is legal C):
|
(even though this is legal C):
|
||||||
|
|
||||||
<p>
|
</p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
/* Non-conventional placement of storage specifier (extern) */
|
/* Non-conventional placement of storage specifier (extern) */
|
||||||
|
|
@ -348,7 +350,6 @@ void bar(Spam (Grok)(Doh));
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
In practice, few (if any) C programmers actually write code like
|
In practice, few (if any) C programmers actually write code like
|
||||||
|
|
@ -357,27 +358,32 @@ if you're feeling particularly obfuscated, you can certainly break SWIG (althoug
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>Running SWIG on C++ source files (what would appear in a .C or .cxx file)
|
<li>
|
||||||
is not recommended. Even though SWIG can parse C++ class declarations,
|
|
||||||
it ignores declarations that are decoupled from their
|
|
||||||
original class definition (the declarations are parsed, but a lot of warning
|
|
||||||
messages may be generated). For example:
|
|
||||||
<p>
|
<p>
|
||||||
|
Running SWIG on C++ source files (the code in a .C, .cpp or .cxx file) is not recommended.
|
||||||
|
The usual approach is to feed SWIG header files for parsing C++ definitions and declarations.
|
||||||
|
The main reason is if SWIG parses a scoped definition or declaration (as is normal for C++ source files),
|
||||||
|
it is ignored, unless a declaration for the symbol was parsed earlier.
|
||||||
|
For example
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
/* Not supported by SWIG */
|
/* bar not wrapped unless foo has been defined and
|
||||||
|
the declaration of bar within foo has already been parsed */
|
||||||
int foo::bar(int) {
|
int foo::bar(int) {
|
||||||
... whatever ...
|
... whatever ...
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>Certain advanced features of C++ such as nested classes
|
<li>
|
||||||
are not yet fully supported. Please see the <a href="SWIGPlus.html">C++ section</a>
|
<p>
|
||||||
|
Certain advanced features of C++ such as nested classes
|
||||||
|
are not yet fully supported. Please see the C++ <a href="SWIGPlus.html#SWIGPlus_nested_classes">Nested classes</a> section
|
||||||
for more information.
|
for more information.
|
||||||
|
</p>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue