Define macro for debug-only code

This commit is contained in:
Martchus 2016-05-26 02:19:44 +02:00
parent 56a01c6472
commit 167e6b4d62
2 changed files with 12 additions and 1 deletions

View File

@ -459,7 +459,7 @@ void ArgumentParser::verifySetup() const
void ArgumentParser::parseArgs(int argc, char *argv[])
{
// initiate parser
verifySetup();
IF_DEBUG_BUILD(verifySetup();)
m_actualArgc = 0; // reset actual agument count
unsigned int actualArgc = 0;
int valuesToRead = 0;

View File

@ -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