slycelote / caide-cpp-inliner

Transform a C++ program consisting of multiple source files and headers into a single self-contained source file without any external dependencies (except for standard system headers). Unused code is not included in the resulting file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Complex macros are not supported

AlCash07 opened this issue · comments

Most of the code gets removed, so the result doesn't compile http://ideone.com/7yQH6L

Multiline thing is unrelated, you'll get the same result if you put it all on a single line. The problem is that macros creating new declarations are generally unsupported. I may try to fix some simple cases, but no promise on that: macros, especially complex ones, are too rare.

Partial class creation using macros, probably, isn't a good style, and I'll rework that. But, in case there are a lot of similar functions, macros can really shorten the code, for example with template point class. Looks like, the inliner works in that case. The only thing is that it leaves all the comments, for some reason.