Fix FC_ASSERT macro for MSVC
This commit is contained in:
parent
dd18675788
commit
1171cf13cd
1 changed files with 8 additions and 1 deletions
|
|
@ -187,11 +187,18 @@ namespace fc
|
||||||
|
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief: Workaround for varying preprocessing behavior between MSVC and gcc
|
||||||
|
*/
|
||||||
|
#define FC_EXPAND_MACRO( x ) x
|
||||||
/**
|
/**
|
||||||
* @brief Checks a condition and throws an assert_exception if the test is FALSE
|
* @brief Checks a condition and throws an assert_exception if the test is FALSE
|
||||||
*/
|
*/
|
||||||
#define FC_ASSERT( TEST, ... ) \
|
#define FC_ASSERT( TEST, ... ) \
|
||||||
do { if( !(TEST) ) { FC_THROW_EXCEPTION( assert_exception, #TEST ": " __VA_ARGS__ ); } } while(0);
|
FC_EXPAND_MACRO( \
|
||||||
|
do { if( !(TEST) ) { FC_THROW_EXCEPTION( assert_exception, #TEST ": " __VA_ARGS__ ); } } while(0); \
|
||||||
|
)
|
||||||
|
|
||||||
#define FC_THROW( FORMAT, ... ) \
|
#define FC_THROW( FORMAT, ... ) \
|
||||||
do { \
|
do { \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue