
I need Boost.Wave preprocessing functionality, but without it doing any macro expansion or substitution, only #including other header files. I'd greatly appreciate any help.

I need Boost.Wave preprocessing functionality, but without it doing any macro expansion or substitution, only #including other header files. I'd greatly appreciate any help.
Avoiding macro expansion is easy enough to achieve, but what about #if/#ifdef/...? Do you only want to suppress macro expansion or do you need to inhibit macro definition as well? Regards Hartmut --------------- Meet me at BoostCon www.boostcon.com

On 06/20/10 17:21, Hartmut Kaiser wrote:
Avoiding macro expansion is easy enough to achieve, but what about #if/#ifdef/...? Do you only want to suppress macro expansion or do you need to inhibit macro definition as well?
macro definition also, in fact everything related to macros. I only want the #include directive to function.

On 06/20/10 17:21, Hartmut Kaiser wrote:
Avoiding macro expansion is easy enough to achieve, but what about #if/#ifdef/...? Do you only want to suppress macro expansion or do you need to inhibit macro definition as well?
macro definition also, in fact everything related to macros. I only want the #include directive to function.
What about constructs like: #ifdef FOO #include <bar1.hpp> #else #include <bar2.hpp> #endif ? Regards Hartmut --------------- Meet me at BoostCon www.boostcon.com

AMDG Hartmut Kaiser wrote:
On 06/20/10 17:21, Hartmut Kaiser wrote:
Avoiding macro expansion is easy enough to achieve, but what about #if/#ifdef/...? Do you only want to suppress macro expansion or do you need to inhibit macro definition as well?
macro definition also, in fact everything related to macros. I only want the #include directive to function.
What about constructs like:
#ifdef FOO #include <bar1.hpp> #else #include <bar2.hpp> #endif
Or: // a.hpp #ifndef BOOST_PP_IS_ITERATING #include <boost/preprocessor/iteration/iterate.hpp> #define BOOST_PP_FILENAME_1 "a_impl.hpp" #define BOOST_PP_ITERATION_LIMITS (1, 10) #include BOOST_PP_ITERATE() #else // ... #endif In Christ, Steven Watanabe

On 06/20/10 20:54, Steven Watanabe wrote:
// a.hpp #ifndef BOOST_PP_IS_ITERATING #include <boost/preprocessor/iteration/iterate.hpp> #define BOOST_PP_FILENAME_1 "a_impl.hpp" #define BOOST_PP_ITERATION_LIMITS (1, 10) #include BOOST_PP_ITERATE() #else // ... #endif
Macro expansion is not allowed so such a construct would not work. Macros are not allowed in the #include directives.

On 06/20/10 20:38, Hartmut Kaiser wrote:
#ifdef FOO #include <bar1.hpp> #else #include <bar2.hpp> #endif
both files are included and all files they include, there is another pass after the "include" pass to figure out what to do. Basically only the #include directive needs to work.
participants (3)
-
anony
-
Hartmut Kaiser
-
Steven Watanabe