Boost logo

Boost Users :

Subject: Re: [Boost-users] [Wave] Making wave driver work with 0 arguments passed as __VA_ARGS__
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2013-08-02 13:47:37


> I'm porting some g++ code to MSVC, and I'm trying to use the Boost.Wave
> driver executable as a preprocessor instead of Visual Studio's. Boost
> 1.54.0.
> I'm generally successful, but I'm having trouble with macros like these:
> #define LOG(msg, ...) whatever
> Usage examples:
> LOG("Hello world!");
> LOG("Hello and print out some variables", foo, bar);
> Both g++ and MSVC have custom extensions that make these examples work,
> but Wave is pretty strict and follows the standard to the letter, so gives
> the error message "not enough arguments for macro LOG" for the first
> example.
> I know it's possible to rewrite each macro like this in a standard-
> compliant way, but it's a lot of work and gets complicated if I want
> recursive macro invocation.
> Is it possible to enable this behaviour in wave somehow? Do I need to
> compile Wave Driver with a specific option? I searched through the docs
> and tried looking at the code, but I can't find anything.

As you said, Wave is very strict - and this is by design. Thus there is no
compile time option enabling this feature. I'd need to have a closer look to
decide how much work it would be to optionally enable this (non-standard)
behavior.

Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu


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