Correct docs wrt C preprocessor constants with a cast
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11541 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
889b156afd
commit
36c4707c0d
1 changed files with 7 additions and 1 deletions
|
|
@ -667,7 +667,6 @@ enum boolean {NO=0, YES=1};
|
|||
enum months {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG,
|
||||
SEP, OCT, NOV, DEC};
|
||||
%constant double BLAH = 42.37;
|
||||
#define F_CONST (double) 5 // A floating pointer constant with cast
|
||||
#define PI_4 PI/4
|
||||
#define FLAGS 0x04 | 0x08 | 0x40
|
||||
|
||||
|
|
@ -706,8 +705,15 @@ the declaration
|
|||
<p>
|
||||
defines a constant because <tt>PI</tt> was already defined as a
|
||||
constant and the value is known.
|
||||
However, for the same conservative reasons even a constant with a simple cast will be ignored, such as
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
<pre>
|
||||
#define F_CONST (double) 5 // A floating pointer constant with cast
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
The use of constant expressions is allowed, but SWIG does not evaluate
|
||||
them. Rather, it passes them through to the output file and lets the C
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue