Boost logo

Boost Users :

From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2007-07-04 17:59:13


Ovanes,

> I need some few macros to be expanded, which are defined in
> some 2-3 headers and I do not want wave to preprocess
> everything (huge source dir). Ideally, it would be great to
> have some functionality, which can notify the preprocessor
> whether to skip the preprocessing directive or not, e.g.
> function void found_include_directive(std::string const
> &filename, bool include_next); (as well as other functions
> like expanding_function_like_macro) from the
> default_preprocessing_hooks interface could additionaly
> return bool value, which would notify the preprocessor
> whether to include and expand the file/macro or not. May be
> in this second case I could solve the first problem as well,
> since I don't really need these defines, they are parsed as
> part of dependency, which is not required in my case.

The following preprocessing hooks now return a boolean value, which when
returning 'true' cause the Wave library to skip the execution of the related
preprocessing action:

. found_directive: allows to skip the whole directive it is called for
. expanding_object_like_macro: allows to skip expansion of the given object
like macro, the macro symbol is copied to the output
. expanding_function_like_macro: allows to skip the expansion of the given
function like macro, the whole macro invocation (including all macro
invocation parameters) are copied to the output without any further
processing.

Please note, that additionally I changed the interpretation of the return
value of the found_include_directive() preprocessing hook: a return value of
'false' now processes the file to include normally and a return value of
'true' now skips the processing of the include file.

The latter change was necessary to make the return values of the
preprocessing hook consistent. Now return 'false' generally means: normal
execution and return 'true' generally means: skip execution of the
corresponding preprocessor action.

HTH
Regards Hartmut


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net