Browse Source

Define macro for debug-only code

experiment/meta_header
Martchus 6 years ago
parent
commit
4fcc8442f8
  1. 4
      application/argumentparser.cpp
  2. 11
      application/global.h

4
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;

11
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

Loading…
Cancel
Save