开发者

Preprocessor Definitions To Identify Debug/Release Mode in VxWorks

Which preprocessor definitions let you identify the build version of a project in VxWorks? I'm looking for something on the lines of _DEBUG (Debug mode)/ _NDEBUG (Release mode) which are used in VC开发者_如何学Python++.

#ifdef _DEBUG
  string strBuildMode = "Debug";
#else
  string strBuildMode = "Release";
#endif


The standard macro (also supported by VC++) is NDEBUG. It has negative logic: it's defined in release builds. The documented function is to turn assert() (from <cassert>) off.


You can add a switch -DDEBUG in the 'tool flags' options of the build properties for debug mode (along with -g option). The macro can then be used in the program to identify the build mode.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜