Add comments to clarify how #define gets wrapped
It took me a while to fully get my head around this, and I'd like to help out future developers.
This commit is contained in:
parent
b57248cc1a
commit
36310c04e5
3 changed files with 11 additions and 0 deletions
|
|
@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
|||
Version 4.1.0 (in progress)
|
||||
===========================
|
||||
|
||||
2022-07-27: ZackerySpytz, olly
|
||||
#1622 Add support for the C++20 spaceship operator (<=>).
|
||||
|
||||
2022-07-26: olly
|
||||
[Tcl] https://sourceforge.net/p/swig/bugs/977/
|
||||
Fix handling of long long on 32-bit platforms. This fix raises
|
||||
|
|
|
|||
|
|
@ -1951,6 +1951,9 @@ clear_directive : CLEAR tm_list SEMI {
|
|||
/* ------------------------------------------------------------
|
||||
%constant name = value;
|
||||
%constant type name = value;
|
||||
|
||||
Note: Source/Preprocessor/cpp.c injects `%constant X = Y;` for
|
||||
each `#define X Y` so that's handled here too.
|
||||
------------------------------------------------------------ */
|
||||
|
||||
constant_directive : CONSTANT identifier EQUAL definetype SEMI {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
*
|
||||
* Integer arithmetic expression evaluator used to handle expressions
|
||||
* encountered during preprocessing.
|
||||
*
|
||||
* Note that this is used for expressions in `#if` and the like, but not
|
||||
* for expressions in `#define` which SWIG wraps as constants - for those
|
||||
* we inject a `%constant` directive which is handled by the parser in
|
||||
* `Source/CParse/parser.y`.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#include "swig.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue