Boost logo

Boost :

Subject: [boost] [wave] _Pragma question
From: Nelson, Erik - 2 (erik.l.nelson_at_[hidden])
Date: 2014-07-28 12:08:06

I'm trying to implement a custom wave pragma using the interpret_pragma hook but having a bit of difficulty.

If I run the preprocess_pragma_output example, the output of preprocessing example.cpp is as expected.

When I try to use the alternative _Pragma() syntax I'm unable to duplicate the results- for example

_Pragma("wave pp \"#define C() 1.0\n\"")


Just preprocesses to


I've been using a gcc pragma page as a reference, and poked around a bit more on the net but have been unable to arrive at anything that works.

Here are the definitions in 'libs/wave/samples/preprocess_pragma_output/example.cpp'

#pragma wave pp ( \
        "#define A() \"some text\" and more\n" \
        "#define B() 1.0\n" \
    ) \
A() // this should produce: "some text" and more
B() // and this expands to 1.0

Does anyone have an idea how to re-write this using the _Pragma() syntax?


This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at If you are not the intended recipient, please delete this message.

Boost list run by bdawes at, gregod at, cpdaniel at, john at