epee: add do while(0) around brace statement in a macro
Allows use in more complex expressions
This commit is contained in:
parent
8512a83572
commit
3d0b54bd01
|
@ -169,7 +169,7 @@ namespace debug
|
||||||
|
|
||||||
|
|
||||||
#define ASSERT_MES_AND_THROW(message) {LOG_ERROR(message); std::stringstream ss; ss << message; throw std::runtime_error(ss.str());}
|
#define ASSERT_MES_AND_THROW(message) {LOG_ERROR(message); std::stringstream ss; ss << message; throw std::runtime_error(ss.str());}
|
||||||
#define CHECK_AND_ASSERT_THROW_MES(expr, message) {if(!(expr)) ASSERT_MES_AND_THROW(message);}
|
#define CHECK_AND_ASSERT_THROW_MES(expr, message) do {if(!(expr)) ASSERT_MES_AND_THROW(message);} while(0)
|
||||||
|
|
||||||
|
|
||||||
#ifndef CHECK_AND_ASSERT
|
#ifndef CHECK_AND_ASSERT
|
||||||
|
|
Loading…
Reference in New Issue