#ifdef DEBUG
/* Your debugging statements here */
#endif
这告诉OCPP如果DEBUG被定义语句随附过程。如果传递 DDEBUG标志,gcc编译器在编译时,这是非常有用的。这将定义DEBUG,所以可以在编译过程中打开调试和关闭。
预定义宏
ANSI C定义了一些宏。虽然每一个都是供编程使用,预定义宏不应该被直接修改。
Macro 描述
__DATE__ The current date as a character literal in "MMM DD YYYY" format
__TIME__ The current time as a character literal in "HH:MM:SS" format
__FILE__ This contains the current filename as a string literal.
__LINE__ This contains the current line number as a decimal constant.
__STDC__ Defined as 1 when the compiler complies with the ANSI standard.
让我们试试下面的例子: