fmt: do not define uint type in global namespace

This commit is contained in:
Shawn Hoffman 2022-05-10 21:17:10 -07:00
parent fa17153ebc
commit 7b8e6c5b36
2 changed files with 5 additions and 7 deletions

View File

@ -1337,8 +1337,8 @@ template <typename Float> constexpr int num_significand_bits() {
template <typename Float>
constexpr auto exponent_mask() ->
typename dragonbox::float_info<Float>::carrier_uint {
using uint = typename dragonbox::float_info<Float>::carrier_uint;
return ((uint(1) << dragonbox::float_info<Float>::exponent_bits) - 1)
using fmt_uint = typename dragonbox::float_info<Float>::carrier_uint;
return ((fmt_uint(1) << dragonbox::float_info<Float>::exponent_bits) - 1)
<< num_significand_bits<Float>();
}
template <typename Float> constexpr auto exponent_bias() -> int {
@ -2425,9 +2425,9 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value) -> OutputIt {
constexpr auto specs = basic_format_specs<Char>();
using floaty = conditional_t<std::is_same<T, long double>::value, double, T>;
using uint = typename dragonbox::float_info<floaty>::carrier_uint;
uint mask = exponent_mask<floaty>();
if ((bit_cast<uint>(value) & mask) == mask)
using fmt_uint = typename dragonbox::float_info<floaty>::carrier_uint;
fmt_uint mask = exponent_mask<floaty>();
if ((bit_cast<fmt_uint>(value) & mask) == mask)
return write_nonfinite(out, std::isnan(value), specs, fspecs);
auto dec = dragonbox::to_decimal(static_cast<floaty>(value));

View File

@ -30,8 +30,6 @@
<AdditionalIncludeDirectories>$(ProjectDir)Settings;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)TAS;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)VideoInterface;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<!--Ignore warnings in locally-instantiated fmt templates-->
<ExternalTemplatesDiagnostics>false</ExternalTemplatesDiagnostics>
</ClCompile>
<Manifest>
<AdditionalManifestFiles>DolphinQt.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>