fix: avoid max macro expansion on Windows

in numeric_limits<T>::max
This commit is contained in:
ToruNiina 2021-06-30 01:43:27 +09:00
parent fe240e1ffc
commit 0858fbfced

View File

@ -180,7 +180,7 @@ struct serializer
{
if((std::find(s.str.cbegin(), s.str.cend(), '\n') != s.str.cend() ||
std::find(s.str.cbegin(), s.str.cend(), '\"') != s.str.cend()) &&
this->width_ != std::numeric_limits<std::size_t>::max())
this->width_ != (std::numeric_limits<std::size_t>::max)())
{
// if linefeed or double-quote is contained,
// make it multiline basic string.
@ -346,7 +346,7 @@ struct serializer
{
serializer ser(*this);
ser.can_be_inlined_ = true;
ser.width_ = std::numeric_limits<std::size_t>::max();
ser.width_ = (std::numeric_limits<std::size_t>::max)();
next_elem += toml::visit(ser, item);
}
else