开发者

Preprocessor Definitions To Identify Debug/Release Mode in VxWorks

开发者 https://www.devze.com 2023-02-20 05:39 出处:网络
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开

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

精彩评论

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