summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2017-03-04 18:12:49 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2017-03-04 18:12:49 +0800
commitc6fca061dd134068c831aefd88d9535a30f423ed (patch)
tree28fc4abecddf8514792a4cb748f1c6e5700274c1 /src/include
parent03addc877bab648ccde022edec29f5b051ce7cb9 (diff)
downloadmrust-c6fca061dd134068c831aefd88d9535a30f423ed.tar.gz
Many many changes to allow compiling in visual studio (Community 2015)
Diffstat (limited to 'src/include')
-rw-r--r--src/include/debug.hpp6
-rw-r--r--src/include/serialise.hpp4
2 files changed, 7 insertions, 3 deletions
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<void(::std::ostream&)> m_cb;
+ FmtLambda(::std::function<void(::std::ostream&)> 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