Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
VxWorksでプロジェクトのビルドバージョンを識別できるプリプロセッサ定義はどれですか?VC ++で使用される_DEBUG(デバッグモード)/ _NDEBUG(リリースモード)の行で何かを探しています。
#ifdef _DEBUG string strBuildMode = "Debug"; #else string strBuildMode = "Release"; #endif
標準マクロ(VC ++でもサポートされています)はNDEBUGです。それは否定的な論理を持っています:それはリリースビルドで定義されています。文書化された機能は、assert()(から<cassert>)をオフにすることです。
NDEBUG
assert()
<cassert>
デバッグ モードのビルド プロパティの「ツール フラグ」オプションにスイッチ -DDEBUG を追加できます (-g オプションと共に)。その後、マクロをプログラムで使用して、ビルド モードを識別できます。