diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2020-02-06 19:57:32 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2020-02-10 12:00:10 -0800 |
commit | 0e0fa27acb74b4f0075afcf59a0dff51a21baddb (patch) | |
tree | 5e5e97c659eb49c6578f768ed9bd347eb1d98cf5 /src/serialize.h | |
parent | 646f0ada0205ae4b3952107e3b1542f06adda32b (diff) |
Get rid of VARINT default argument
This removes the need for the GNU C++ extension of variadic macros.
Diffstat (limited to 'src/serialize.h')
-rw-r--r-- | src/serialize.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/serialize.h b/src/serialize.h index 75d6b52154..cee7225bcb 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -493,12 +493,13 @@ public: template<typename Formatter, typename T> static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); } -#define VARINT(obj, ...) Using<VarIntFormatter<__VA_ARGS__>>(obj) +#define VARINT_MODE(obj, mode) Using<VarIntFormatter<mode>>(obj) +#define VARINT(obj) Using<VarIntFormatter<VarIntMode::DEFAULT>>(obj) #define COMPACTSIZE(obj) CCompactSize(REF(obj)) #define LIMITED_STRING(obj,n) LimitedString< n >(REF(obj)) /** Serialization wrapper class for integers in VarInt format. */ -template<VarIntMode Mode=VarIntMode::DEFAULT> +template<VarIntMode Mode> struct VarIntFormatter { template<typename Stream, typename I> void Ser(Stream &s, I v) |