Skip to content

Commit

Permalink
Disable slow windows build and simplify write_loc
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Sep 11, 2022
1 parent c3494ae commit 58c4c01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
shell: msys2 {0}
strategy:
matrix:
sys: [ mingw64, mingw32, ucrt64 ]
sys: [ mingw64, ucrt64 ]
steps:
- uses: msys2/setup-msys2@v2
with:
Expand Down
28 changes: 11 additions & 17 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -2053,12 +2053,12 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
});
}

template <typename Char, typename T, FMT_ENABLE_IF(!is_float128<T>::value)>
auto make_loc_value(T value) -> basic_format_arg<buffer_context<Char>> {
return make_arg<buffer_context<Char>>(value);
template <typename T, FMT_ENABLE_IF(!is_float128<T>::value)>
auto make_loc_value(T value) -> basic_format_arg<format_context> {
return make_arg<format_context>(value);
}
template <typename Char, typename T, FMT_ENABLE_IF(is_float128<T>::value)>
auto make_loc_value(T) -> basic_format_arg<buffer_context<Char>> {
template <typename T, FMT_ENABLE_IF(is_float128<T>::value)>
auto make_loc_value(T) -> basic_format_arg<format_context> {
return {};
}

Expand All @@ -2067,7 +2067,7 @@ FMT_API auto write_loc(appender out, basic_format_arg<format_context> value,
const format_specs& specs, locale_ref loc) -> bool;

template <typename OutputIt, typename Char>
inline auto write_loc(OutputIt, basic_format_arg<buffer_context<Char>>,
inline auto write_loc(OutputIt, basic_format_arg<format_context>,
const basic_format_specs<Char>&, locale_ref) -> bool {
return false;
}
Expand Down Expand Up @@ -2190,10 +2190,8 @@ template <typename Char, typename OutputIt, typename T,
FMT_CONSTEXPR FMT_INLINE auto write(OutputIt out, T value,
const basic_format_specs<Char>& specs,
locale_ref loc) -> OutputIt {
if (specs.localized &&
write_loc(out, make_loc_value<Char>(value), specs, loc)) {
if (specs.localized && write_loc(out, make_loc_value(value), specs, loc))
return out;
}
return write_int_noinline(out, make_write_int_arg(value, specs.sign), specs,
loc);
}
Expand All @@ -2205,10 +2203,8 @@ template <typename Char, typename OutputIt, typename T,
FMT_CONSTEXPR FMT_INLINE auto write(OutputIt out, T value,
const basic_format_specs<Char>& specs,
locale_ref loc) -> OutputIt {
if (specs.localized &&
write_loc(out, make_loc_value<Char>(value), specs, loc)) {
if (specs.localized && write_loc(out, make_loc_value(value), specs, loc))
return out;
}
return write_int(out, make_write_int_arg(value, specs.sign), specs, loc);
}

Expand Down Expand Up @@ -3315,11 +3311,9 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value,
basic_format_specs<Char> specs, locale_ref loc = {})
-> OutputIt {
if (const_check(!is_supported_floating_point(value))) return out;
if (specs.localized &&
write_loc(out, make_loc_value<Char>(value), specs, loc)) {
return out;
}
return write_float(out, value, specs, loc);
return specs.localized && write_loc(out, make_loc_value(value), specs, loc)
? out
: write_float(out, value, specs, loc);
}

template <typename Char, typename OutputIt, typename T,
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/xchar.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ template <typename T>
using is_exotic_char = bool_constant<!std::is_same<T, char>::value>;

template <typename OutputIt>
auto write_loc(OutputIt out, basic_format_arg<buffer_context<wchar_t>> val,
auto write_loc(OutputIt out, basic_format_arg<format_context> val,
const basic_format_specs<wchar_t>& specs, locale_ref loc)
-> bool {
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
Expand Down

0 comments on commit 58c4c01

Please sign in to comment.