You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on the project that is consuming fmt{} (particularly Windows), min and max may be defined as macros, which causes compile errors in write_fractional_seconds. Specifically, lines 1056 and 1067:
While #undef'ng both min and max is one solution, this can break other compilation bits that still expect them to be defined.
A portable solution that doesn't resort to macro finagling is to explicitly use the data type:
int leading_zeroes = std::max(0, num_fractional_digits - num_digits);
leading_zeroes = std::min(leading_zeroes, precision);
The text was updated successfully, but these errors were encountered:
phprus
added a commit
to phprus/fmt
that referenced
this issue
Dec 14, 2022
Depending on the project that is consuming fmt{} (particularly Windows), min and max may be defined as macros, which causes compile errors in write_fractional_seconds. Specifically, lines 1056 and 1067:
int leading_zeroes = std::max(0, num_fractional_digits - num_digits);
leading_zeroes = std::min(leading_zeroes, precision);
While #undef'ng both min and max is one solution, this can break other compilation bits that still expect them to be defined.
A portable solution that doesn't resort to macro finagling is to explicitly use the data type:
int leading_zeroes = std::max(0, num_fractional_digits - num_digits);
leading_zeroes = std::min(leading_zeroes, precision);
The text was updated successfully, but these errors were encountered: