Menu

#1163 Does not support cascading macro invocations

None
closed-duplicate
nobody
5
2023-04-19
2011-05-09
No

Hi,

I have been toying with Boost.Preprocessor, and maybe the SWIG preprocessor is not too far from being able to grok it. But there is a first issue, demonstrated as follows.

Thanks in advance.

$ swig -version

SWIG Version 2.0.3

Compiled with /usr/bin/g++-4.2 [i386-apple-darwin10.7.0]

Configured options: +pcre

Please see http://www.swig.org for reporting bugs and further information

$ cat /tmp/bar.cc
#define ONE(X) TWO
#define TWO(X) X

ONE(1)(2)

$ swig -E -java /tmp/bar.cc | tail

]

]
%includefile(maininput="/tmp/bar.cc") "/tmp/bar.cc" [

TWO(2)
]

$ g++ -Wall -E /tmp/bar.cc
# 1 "/tmp/bar.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/tmp/bar.cc"

2

Discussion

  • Anonymous

    Anonymous - 2011-05-09

    File to preprocess

     
  • Anonymous

    Anonymous - 2011-05-09
    • summary: Does not support repeat cascading --> Does not support cascading macro invocations
     
  • Olly Betts

    Olly Betts - 2022-01-31
    • status: open --> closed-duplicate
    • Group: -->
     
  • Olly Betts

    Olly Betts - 2022-01-31

    Still present in git master.

    There's an open ticket which I'm sure is the same problem in the github tracker we now use. I've pasted the example here in there as it's a simpler testcase and will close this as a duplicate:

    https://github.com/swig/swig/issues/1881

     
  • Olly Betts

    Olly Betts - 2023-04-19

    Fixed on git master by https://github.com/swig/swig/commit/26dfe3394810a72e85c4c52ee568ff44cfbcac76. Fix should be in 4.2.0.

    (https://github.com/swig/swig/issues/1881 seems to actually be slightly different as that's not fixed by this change)

     

Log in to post a comment.