From ee3e68dc166b840276cdca0231de72cc8d5e6808 Mon Sep 17 00:00:00 2001 From: vitaut Date: Fri, 20 Nov 2015 08:14:10 -0800 Subject: [PATCH] Improve compatibility with bcc32 --- format.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/format.h b/format.h index 055b7624..291506bf 100644 --- a/format.h +++ b/format.h @@ -967,6 +967,13 @@ struct Conditional { typedef T type; }; template struct Conditional { typedef F type; }; +// For bcc32 which doesn't understand ! in template argumetns. +template +struct Not { enum { value = 0 }; }; + +template<> +struct Not { enum { value = 1 }; }; + // A helper function to suppress bogus "conditional expression is constant" // warnings. template @@ -1100,7 +1107,8 @@ class MakeValue : public Arg { template MakeValue(const T &value, - typename EnableIf::value == 0, int>::type = 0) { + typename EnableIf::value>::value, int>::type = 0) { custom.value = &value; custom.format = &format_custom_arg; } @@ -1428,7 +1436,7 @@ class BasicFormatter : private internal::FormatterBase { public: BasicFormatter(const ArgList &args, BasicWriter &w) - : FormatterBase(args), writer_(w) {} + : internal::FormatterBase(args), writer_(w) {} BasicWriter &writer() { return writer_; }