9.5.1 Conditional compilation symbols

王朝other·作者佚名  2006-01-10
窄屏简体版  字體: |||超大  

9.5.1 Conditional compilation symbols

The conditional compilation functionality provided by the #if, #elif, #else,

and #endif directives is

controlled through pre-processing expressions (§9.5.2) and conditional

compilation symbols.

conditional-symbol::

Any identifier-or-keyword except true or false

A conditional compilation symbol has two possible states: defined or

undefined. At the beginning of the lexical

processing of a source file, a conditional compilation symbol is undefined

unless it has been explicitly defined by

an external mechanism (such as a command-line compiler option). When a

#define directive is processed, the

conditional compilation symbol named in that directive becomes defined in

that source file. The symbol remains

defined until an #undef directive for that same symbol is processed, or

until the end of the source file is reached.

An implication of this is that #define and #undef directives in one source

file have no effect on other source

files in the same program.

The name space for conditional compilation symbols is distinct and separate

from all other named entities in a

C# program. Conditional compilation symbols can only be referenced in

#define and #undef directives and in

pre-processing expressions.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航