Skip to content

Commit 4c86ed4

Browse files
committed
Macros wrapped as constants documentation improvements.
Closes swig#1618
1 parent 719eea0 commit 4c86ed4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Doc/Manual/SWIG.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,32 @@ <H3><a name="SWIG_nn12">5.2.3 Constants</a></H3>
826826
</pre>
827827
</div>
828828

829+
<p>
830+
This logic can lead to false attempts at converting <tt>#define</tt> into <tt>%constant</tt> though.
831+
For example the following case does not have any undefined symbols within the macro:
832+
</p>
833+
834+
<div class="code">
835+
<pre>
836+
// For indicating pure virtual functions such as: virtual void f() PURE;
837+
#define PURE = 0
838+
</pre>
839+
</div>
840+
841+
<p>
842+
A warning is issued:
843+
</p>
844+
845+
<div class="shell">
846+
<pre>
847+
pure.h:1: Warning 305: Bad constant value (ignored).
848+
</pre>
849+
</div>
850+
851+
<p>
852+
In such cases simply ignore the warning or suppress it using the normal warning suppression techniques.
853+
</p>
854+
829855
<p>
830856
The use of constant expressions is allowed, but SWIG does not evaluate
831857
them. Rather, it passes them through to the output file and lets the C

0 commit comments

Comments
 (0)