Skip to content

Commit 0586189

Browse files
committed
Workaround min macro for windows.h
Sigh. min() is #defined by default in windows.h and interferes with std::min(). Insert the usual workaround.
1 parent ab60795 commit 0586189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tinyformat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ inline void formatTruncated(std::ostream& out, const T& value, int ntrunc)
268268
std::ostringstream tmp;
269269
tmp << value;
270270
std::string result = tmp.str();
271-
out.write(result.c_str(), std::min(ntrunc, static_cast<int>(result.size())));
271+
out.write(result.c_str(), (std::min)(ntrunc, static_cast<int>(result.size())));
272272
}
273273
#define TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(type) \
274274
inline void formatTruncated(std::ostream& out, type* value, int ntrunc) \

0 commit comments

Comments
 (0)