diff --git a/fmt/format.h b/fmt/format.h index 8911c4d4..5bc2911d 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -1513,15 +1513,16 @@ constexpr uint64_t make_type() { return 0; } // Maximum number of arguments with packed types. enum { MAX_PACKED_ARGS = 16 }; -template -inline typename std::enable_if>::type +template +inline typename std::enable_if< + IS_PACKED, Value>::type make_arg(const T& value) { return MakeValue(value); } -template +template inline typename std::enable_if< - !PACKED, basic_format_arg>::type + !IS_PACKED, basic_format_arg>::type make_arg(const T& value) { return MakeArg(value); } @@ -1531,22 +1532,24 @@ template class format_arg_store { private: static const size_t NUM_ARGS = sizeof...(Args); - static const bool PACKED = NUM_ARGS < internal::MAX_PACKED_ARGS; + + // Packed is a macro on MinGW so use IS_PACKED instead. + static const bool IS_PACKED = NUM_ARGS < internal::MAX_PACKED_ARGS; typedef typename Context::char_type char_type; - typedef typename std::conditional, basic_format_arg>::type value_type; // If the arguments are not packed, add one more element to mark the end. - typedef std::array Array; + typedef std::array Array; Array data_; public: static const uint64_t TYPES = internal::make_type(); format_arg_store(const Args &... args) - : data_(Array{internal::make_arg(args)...}) {} + : data_(Array{internal::make_arg(args)...}) {} const value_type *data() const { return data_.data(); } };