From 1171cf13cd6ba6002ab626746f508815e2a2dff9 Mon Sep 17 00:00:00 2001 From: dnotestein Date: Sun, 11 Aug 2013 12:12:45 -0400 Subject: [PATCH] Fix FC_ASSERT macro for MSVC --- include/fc/exception/exception.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/fc/exception/exception.hpp b/include/fc/exception/exception.hpp index 55b7379..d907f72 100644 --- a/include/fc/exception/exception.hpp +++ b/include/fc/exception/exception.hpp @@ -187,11 +187,18 @@ 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 */ #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, ... ) \ do { \