
Hartmut Kaiser skrev:
If you have a list of macros to leave untouched it is easily implemented. All you (somebody) will have to do is to modify the expanding_function_like_macro() and expanding_object_like_macro() preprocessing hooks to return true for all macros Wave shouldn't touch (see tools/wave/trace_macro_expansion.hpp).
Is there also a hook to decide if an #if #else expression should be evaluated or left as it is?
You probably don't want system headers to be expanded, though. As long as you don't care about the defined macros in those headers you can skip processing of certain include directives the same way as above: change the found_include_directive() preprocessing hook to return true for the #include's to skip.
Are you saying that we need to inline the headers or wave wont see the macro definitions? Would it be possible to split the parsing of includes from the inline expansion? I expect that we do need the defined macros from included files if we want everything correctly evaluated. But if it is to be readable no headers should be expanded. We want the source files to look like hand written code. / Jonas