From c6fca061dd134068c831aefd88d9535a30f423ed Mon Sep 17 00:00:00 2001 From: "John Hodge (bugs)" Date: Sat, 4 Mar 2017 18:12:49 +0800 Subject: Many many changes to allow compiling in visual studio (Community 2015) --- src/include/debug.hpp | 6 +++++- src/include/serialise.hpp | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/debug.hpp b/src/include/debug.hpp index 756d6ef2..2bbecb39 100644 --- a/src/include/debug.hpp +++ b/src/include/debug.hpp @@ -62,11 +62,15 @@ public: struct FmtLambda { ::std::function m_cb; + FmtLambda(::std::function cb): + m_cb(cb) + { } friend ::std::ostream& operator<<(::std::ostream& os, const FmtLambda& x) { x.m_cb(os); return os; } }; -#define FMT_CB(os, ...) ::FmtLambda { [&](auto& os) { __VA_ARGS__ } } +#define FMT_CB(os, ...) ::FmtLambda( [&](auto& os) { __VA_ARGS__; } ) +#define FMT_CB_S(...) ::FmtLambda( [&](auto& _os) { _os << __VA_ARGS__; } ) diff --git a/src/include/serialise.hpp b/src/include/serialise.hpp index 8b1cea98..0d6d781a 100644 --- a/src/include/serialise.hpp +++ b/src/include/serialise.hpp @@ -25,7 +25,7 @@ class Deserialiser; #define SERIALISE_TU(class_, tag_str, val_name, ...) SERIALISE_TYPE(class_::, tag_str,\ {\ s << class_::tag_to_str(this->tag());\ - TU_MATCH(class_, (*this), (val_name), __VA_ARGS__);\ + TU_MATCH(class_, (*this), (val_name), __VA_ARGS__)\ },/* */ {\ ::std::string STU_tag_str;\ @@ -41,7 +41,7 @@ class Deserialiser; */ auto& VAL_NAME = this->as_##TAG(); /* */ __VA_ARGS__/* */} break; -#define SERIALISE_TU_MATCH_ARMS(CLASS, NAME, ...) TU_GMA(__VA_ARGS__)(SERIALISE_TU_MATCH_ARM, (CLASS, NAME), __VA_ARGS__) +#define SERIALISE_TU_MATCH_ARMS(CLASS, NAME, ...) TU_EXP1( TU_GMA(__VA_ARGS__)(SERIALISE_TU_MATCH_ARM, (CLASS, NAME), __VA_ARGS__) ) class DeserialiseFailure: public ::std::runtime_error -- cgit v1.2.3