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.
Other
32 stars 12 forks source link

Complex macros are not supported #7

Closed AlCash07 closed 2 months ago

AlCash07 commented 7 years ago

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

slycelote commented 7 years ago

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.

AlCash07 commented 7 years ago

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.