Predefined Macros

The following table lists the macros, which are predefined by the Wave library. Some of these (all except the __LINE__, __FILE__, __BASE_FILE__, __DATE__, __TIME__, __STDC__, __INCLUDE_LEVEL__ and __cplusplus macros) may be undefined from the command line of the driver executable (see the -U option) or through the function remove_macro_definition().

Summary of predefined macros
Name

Value

Undefinable
__STDC__

1 (a decimal constant)

yes

__cplusplus

199711L (a decimal constant), this is defined in C++ mode only (C99 mode is off)
In the C++0x mode this decimal constant is guaranteed to be larger than 199711L (the concrete value is to be defined by the C++ committee).

no

__LINE__

The line number of the current source line (a decimal constant)

no

__FILE__

The presumed name of the source file (a character string literal)

no

__BASE_FILE__

This macro expands to the name of the main input file (a character string literal). This is the source file that was specified during construction of the wave::context template.

no

__DATE__

The date of translation of the source file (a character string literal of the form
"Mmm dd yyyy", where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10).

no

__TIME__

The time of translation of the source file (a character string literal of the form "hh:mm:ss"
as in the time generated by the asctime function).

no

__INCLUDE_LEVEL__

A decimal integer constant that represents the depth of nesting in include
files. The value of this macro is incremented on every #include directive
and decremented at every end of file.

no

__WAVE__
__SPIRIT_PP__

The version of the driver program (a hexadecinal constant of the form 0xMmrr, where 'M' is the major version number, 'm' the minor version number and 'rr' the release number).

yes

__WAVE_VERSION__
__SPIRIT_PP_VERSION__

The full version number of the driver program (a hexadecimal constant of the form 0xMmrrbbbb, where 'M' is the major version number, 'm' the minor version number, 'rr' the release number and 'bbbb' the build number).

yes

__WAVE_VERSION_STR__
__SPIRIT_PP_VERSION_STR__

The full version number of the driver program (a character string literal of the form "M.m.rr.bbbb", where 'M' is the major version number, 'm' the minor version number, 'rr' the release number and 'bbbb' the build number).

yes

__STDC_VERSION__

199901L (a decimal constant), this is defined in C99 mode only

yes

__STDC_HOSTED__

0L (a decimal constant), this is defined in C99 mode only

yes

__WAVE_HAS_VARIADICS__

1 (a decimal constant), this is defined in C++ mode only if variadics and placemarkers are enabled, and it is defined in the C99 mode

no

__WAVE_CONFIG__

The configuration information used during the compilation of the Wave library. This is a hexadecimal constant, where each of the bits represents a certain configuration option enabled/disabled during the compilation. You can query this contant using the following macro constants available in the wave_config_constant.hpp file:

BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS_CONFIG (value: 0x1)
Variadics and placemarkers are supported

BOOST_WAVE_SUPPORT_PRAGMA_ONCE_CONFIG (value: 0x02)
#pragma once (_Pragma(once)) is supported

BOOST_WAVE_SUPPORT_MS_EXTENSIONS_CONFIG (value: 0x04)
MS Extensions are supported

BOOST_WAVE_PREPROCESS_PRAGMA_BODY_CONFIG (value: 0x08)
The bodies of #pragma statements (operator _Pragma) will be preprocessed

BOOST_WAVE_USE_STRICT_LEXER_CONFIG (value: 0x10)
The C/C++ lexers recognize the strict C99/C++ basic source character set. If it is not defined or defined to zero, the lexers recognize the '$' character as part of identifiers.


yes