Compatibility with fmtlib 10.1.x

This commit is contained in:
Exzap 2023-10-02 18:52:54 +02:00
parent ff9d180154
commit 757d458161
8 changed files with 39 additions and 38 deletions

View file

@ -908,6 +908,11 @@ void _emitOperandInputCode(LatteDecompilerShaderContext* shaderContext, LatteDec
{
char floatAsStr[32];
size_t floatAsStrLen = fmt::format_to_n(floatAsStr, 32, "{:#}", *(float*)&constVal).size;
if(floatAsStrLen > 0 && floatAsStr[floatAsStrLen-1] == '.')
{
floatAsStr[floatAsStrLen] = '0';
floatAsStrLen++;
}
cemu_assert_debug(floatAsStrLen >= 3); // shortest possible form is "0.0"
src->add(std::string_view(floatAsStr, floatAsStrLen));
}