diff --git a/application/argumentparser.cpp b/application/argumentparser.cpp index 5715c39..dab3812 100644 --- a/application/argumentparser.cpp +++ b/application/argumentparser.cpp @@ -441,9 +441,7 @@ void ArgumentParser::verifySetup() const void ArgumentParser::parseArgs(int argc, char *argv[]) { // initiate parser -#ifdef DEBUG_BUILD - verifySetup(); -#endif + IF_DEBUG_BUILD(verifySetup();) m_actualArgc = 0; // reset actual agument count unsigned int actualArgc = 0; int valuesToRead = 0; diff --git a/application/global.h b/application/global.h index 220bde4..ab8b743 100644 --- a/application/global.h +++ b/application/global.h @@ -82,4 +82,15 @@ #define VAR_UNUSED(x) (void)x; +/*! + * \def IF_DEBUG_BUILD + * \brief Wraps debug-only lines conveniently. + */ + +#ifdef DEBUG_BUILD +# define IF_DEBUG_BUILD(x) x +#else +# define IF_DEBUG_BUILD(x) +#endif + #endif // MARTCHUSUTILITY_LIBRARY_GLOBAL_H