Fix build on gcc 4.4

This commit is contained in:
Victor Zverovich
2018-10-24 06:34:28 -07:00
parent 9d0c9c4bb1
commit 20c708bf6d
16 changed files with 71 additions and 63 deletions

View File

@@ -189,7 +189,7 @@ enum class color : uint32_t {
white = 0xFFFFFF, // rgb(255,255,255)
white_smoke = 0xF5F5F5, // rgb(245,245,245)
yellow = 0xFFFF00, // rgb(255,255,0)
yellow_green = 0x9ACD32, // rgb(154,205,50)
yellow_green = 0x9ACD32 // rgb(154,205,50)
}; // enum class color
// rgb is a struct for red, green and blue colors.

View File

@@ -91,8 +91,10 @@
#if FMT_HAS_FEATURE(cxx_explicit_conversions) || \
FMT_GCC_VERSION >= 405 || FMT_MSC_VER >= 1800
# define FMT_USE_EXPLICIT 1
# define FMT_EXPLICIT explicit
#else
# define FMT_USE_EXPLICIT 0
# define FMT_EXPLICIT
#endif
@@ -658,7 +660,12 @@ FMT_MAKE_VALUE_SAME(long_long_type, long long)
FMT_MAKE_VALUE_SAME(ulong_long_type, unsigned long long)
FMT_MAKE_VALUE(int_type, signed char, int)
FMT_MAKE_VALUE(uint_type, unsigned char, unsigned)
FMT_MAKE_VALUE(char_type, typename C::char_type, int)
// This doesn't use FMT_MAKE_VALUE because of ambiguity in gcc 4.4.
template <typename C, typename Char>
FMT_CONSTEXPR typename std::enable_if<
std::is_same<typename C::char_type, Char>::value,
init<C, int, char_type>>::type make_value(Char val) { return val; }
template <typename C>
FMT_CONSTEXPR typename std::enable_if<
@@ -718,7 +725,7 @@ inline typename std::enable_if<
template <typename C, typename T, typename Char = typename C::char_type>
inline typename std::enable_if<
!convert_to_int<T, Char>::value &&
!convert_to_int<T, Char>::value && !std::is_same<T, Char>::value &&
!std::is_convertible<T, basic_string_view<Char>>::value &&
!internal::is_constructible<basic_string_view<Char>, T>::value &&
!internal::has_to_string_view<T>::value,

View File

@@ -1725,7 +1725,7 @@ FMT_CONSTEXPR void set_dynamic_spec(
T &value, basic_format_arg<Context> arg, ErrorHandler eh) {
unsigned long long big_value =
visit_format_arg(Handler<ErrorHandler>(eh), arg);
if (big_value > (std::numeric_limits<int>::max)())
if (big_value > to_unsigned((std::numeric_limits<int>::max)()))
eh.on_error("number is too big");
value = static_cast<T>(big_value);
}
@@ -2111,7 +2111,7 @@ FMT_CONSTEXPR void parse_format_string(
++p;
if (p == end)
return handler.on_error("invalid format string");
if (*p == '}') {
if (static_cast<char>(*p) == '}') {
handler.on_arg_id();
handler.on_replacement_field(p);
} else if (*p == '{') {