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:
William S Fulton 2009-08-12 22:07:49 +00:00
commit 36c4707c0d

View file

@ -667,7 +667,6 @@ enum boolean {NO=0, YES=1};
enum months {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, enum months {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG,
SEP, OCT, NOV, DEC}; SEP, OCT, NOV, DEC};
%constant double BLAH = 42.37; %constant double BLAH = 42.37;
#define F_CONST (double) 5 // A floating pointer constant with cast
#define PI_4 PI/4 #define PI_4 PI/4
#define FLAGS 0x04 | 0x08 | 0x40 #define FLAGS 0x04 | 0x08 | 0x40
@ -706,8 +705,15 @@ the declaration
<p> <p>
defines a constant because <tt>PI</tt> was already defined as a defines a constant because <tt>PI</tt> was already defined as a
constant and the value is known. 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> </p>
<div class="code">
<pre>
#define F_CONST (double) 5 // A floating pointer constant with cast
</pre>
</div>
<p> <p>
The use of constant expressions is allowed, but SWIG does not evaluate 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 them. Rather, it passes them through to the output file and lets the C