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
File to preprocess
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
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)