Merge branch 'phoenix' of https://github.com/InvictusInnovations/fc into phoenix

This commit is contained in:
Daniel Larimer 2014-06-11 15:17:33 -04:00
commit 6e7da6ca78
2 changed files with 8 additions and 4 deletions

View file

@ -297,10 +297,12 @@ namespace fc
do { throw EXCEPTION_TYPE( FC_LOG_MESSAGE( error, "", FC_FORMAT_ARG_PARAMS(__VA_ARGS__) ) ); } while(false);
//#define FC_THROW( FORMAT, ... )
// FC_INDIRECT_EXPAND workas around a bug in Visual C++ variadic macro processing that prevents it
// from separating __VA_ARGS__ into separate tokens
#define FC_INDIRECT_EXPAND(MACRO, ARGS) MACRO ARGS
#define FC_THROW( ... ) \
do { \
throw fc::exception( FC_LOG_MESSAGE( error, __VA_ARGS__ ) ); \
throw fc::exception( FC_INDIRECT_EXPAND(FC_LOG_MESSAGE, ( error, __VA_ARGS__ )) ); \
} while(0)
#define FC_EXCEPTION( EXCEPTION_TYPE, FORMAT, ... ) \

View file

@ -131,8 +131,10 @@ namespace fc
#define FC_FORMAT( SEQ )\
BOOST_PP_SEQ_FOR_EACH( FC_FORMAT_ARG, v, SEQ )
#define FC_FORMAT_ARG_PARAMS( SEQ )\
BOOST_PP_SEQ_FOR_EACH( FC_FORMAT_ARGS, v, SEQ )
// takes a ... instead of a SEQ arg because it can be called with an empty SEQ
// from FC_CAPTURE_AND_THROW()
#define FC_FORMAT_ARG_PARAMS( ... )\
BOOST_PP_SEQ_FOR_EACH( FC_FORMAT_ARGS, v, __VA_ARGS__ )
#define idump( SEQ ) \
ilog( FC_FORMAT(SEQ), FC_FORMAT_ARG_PARAMS(SEQ) )