判断平台相关,判断程序是属于debug版本还是release版本,我们会这么做。
#ifdef WIN32 #else #endif
#ifdef DEBUG // 如果是调试版本 #else //发布版本 #endif // DEBUG
我的平台是VS2012。
项目属性->配置属性->C/C++ ->预处理器->预处理器定义,可以看到WIN32的定义。
但是同样的方法没有找到DEBUG的定义。在主窗口调试按钮旁边,可以选择版本,是DEBUG 还是 RELEASE。我觉得这个宏应该是从这里来的。