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().
下表列出了由 Wave 庫預定義的宏。其中一些(除了 __LINE__, __FILE__, __BASE_FILE__, __DATE__, __TIME__, __STDC__, __INCLUDE_LEVEL____cplusplus 以外的所有宏)可以通過驅動器執行文件的命令行(參見 -U 選項)或通過函數 remove_macro_definition() 進行去定義。

Summary of predefined macros
預定義宏概要
Name
名字

Value 

Undefinable
可去定義
__STDC__

1 (a decimal constant)

1 (十進制常量)

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).

199711L (十進制常量),僅在C++模式下定義(C99模式下關閉)
在C++0x模式下,該十進制常量保證大於199711L (具體的值由C++委員會定義)。

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.

該宏展開為主輸入文件的名字(字符串文字)。它是在構造 wave::context 模板時指定的源文件。

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).

翻譯源文件的日期(形如"Mmm dd yyyy"的字符串文字,其中月份名與 asctime 函數生成的一樣,如果 dd 小於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).

翻譯源文件的時間(形如"hh:mm:ss"的字符串文字,與 asctime 函數生成的一樣)。

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.

十進制整數常量,表示包含文件的嵌套深度。該宏的值在每次 #include 指令中加一,在每個文件結束時減一。

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).

驅動器程序的版本號(形如0xMmrr的十六進制常量,其中'M'為主版本號,'m'為次版本號,'rr'為發佈號)。

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).

驅動器程序的完整版本號(形如0xMmrrbbbb的十六進制常量,其中'M' 為主版本號,'m'為次版本號,'rr'為發佈號,'bbbb'為構建號)。

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).

驅動器程序的完整版本號(形如"M.m.rr.bbbb"的字符串文字,其中'M' 為主版本號,'m'為次版本號,'rr'為發佈號,'bbbb'為構建號).

yes

__STDC_VERSION__

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

199901L (十進制常量),僅在C99模式下定義。

yes

__STDC_HOSTED__

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

0L (十進制常量),僅在C99模式下定義。

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

1 (十進制常量),在C++模式下僅當variadics和placemarkers可用時定義,在C99模式下定義。

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.

在編譯Wave庫時使用的配置信息。這是一個十六進制常量,其中每個二進制位表示編譯時激活/禁止某個特定的配置選項。你可以使用在 wave_config_constant.hpp 文件中提供的以下宏常量來查詢該常量:

BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS_CONFIG (value: 0x1
支持 Variadics 和 placemarkers

BOOST_WAVE_SUPPORT_PRAGMA_ONCE_CONFIG (value: 0x02)
支持 #pragma once (_Pragma(once))

BOOST_WAVE_SUPPORT_MS_EXTENSIONS_CONFIG (value: 0x04)
支持 MS 擴展

BOOST_WAVE_PREPROCESS_PRAGMA_BODY_CONFIG (value: 0x08)
對 #pragma 語句體(操作符 _Pragma)進行預處理

BOOST_WAVE_USE_STRICT_LEXER_CONFIG (value: 0x10)
C/C++ lexer 將識別嚴格的C99/C++基本源文件字符集。如果該宏未定義或定義為零,則 lexer 將字符 '$' 識別為標識符的一部分。

yes