Provided the code was only in an #if block used for pre-generation (or the code is *only* used for pre-gen), you could have wave produce that. E.g. use an object-like macro to get a non-macro-operator hash mark:
#if PREGENERATING_HEADERS
#define HASH #
HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
vector(vector&& rhs)
: vec(std::forward
How about making macros for #if, #else, #endif
BOOST_KEEP_UNTIL_WAVE_OUTPUT(if) -> #if
Then tell Wave not to translate it and translate it in the output.
the problem is that pp macros can't be expanded to pp directives.
John ________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of Joel de Guzman [djowel@gmail.com] Sent: 21 January 2014 06:29 To: boost@lists.boost.org Subject: Re: [boost] [wave] preprocessor directives in output
On 1/21/14, 9:46 AM, Eric Niebler wrote:
I'm looking at automating the regeneration of Fusion's preprocess headers with the wave tool. Currently, it's impossible because of stuff like this (from container\vector\vector.hpp):
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) vector(vector&& rhs) : vec(std::forward
(rhs.vec)) {} #endif When the wave driver is run, either BOOST_NO_CXX11_RVALUE_REFERENCES is defined, in which case the block of code gets left out, or else it isn't, in which case the block of code is left in. Both are wrong. What should happen is that the #if and #else directives should be present in wave's output.
I can keep wave from expanding certain named macros with the -N switch, but there doesn't seem to be a way to selectively keep wave from evaluating #if/#else directives. Or is there?
I asked Hartmut this same question before. IIRC, it's an issue that has no workaround (or fix) yet. I hope I am wrong.
Regards, -- Joel de Guzman http://www.ciere.com http://boost-spirit.com http://www.cycfi.com/
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost