C++2003, Annex B, (informative)
Implementation quantities (sorry, don't have C++2011 handy)
2) The limits may constrain quantities that include those described below or others. The bracketed number
following each quantity is recommended as the minimum for that quantity. However, these quantities are
only guidelines and do not determine compliance.
…
- Characters in one logical source line [65 536].
You didn't ask about these, but they might be useful, also:
- Nesting levels of parenthesized expressions within a full expression [256].
- Macro identifiers simultaneously defined in one translation unit [65 536].
- Arguments in one macro invocation [256].
- Number of characters in an internal identifier or macro name [1 024].
- Macro identifiers simultaneously defined in one translation unit [65 536].
- Parameters in one macro definition [256].
Postscript: It is worth noting what "one logical source line" is. A
logical source line is what you have
after:
- Physical source file characters are mapped to the basic source
character set
- Trigraph
sequences (2.3) are replaced by corresponding single-character internal representations
- Each instance of a new-line character and an immediately preceding backslash character is deleted
The logical source line is what you have before:
- The source file is decomposed into preprocessing tokens
- Preprocessing directives are executed and macro invocations are expanded.
[quotes from C++ 2003, 2.1 Phases of Translation]
So, if the OP's concern is that the macros expand to beyond a reasonable line length, my answer is irrelevant. If the OP's concern is that his source code (after dealing with
,
) might be too long, my answer stands.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…