Skip to content

Commit d7e8c4f

Browse files
committed
Protect std::max against macro definitions
Fixes #150.
1 parent 7700de3 commit d7e8c4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hdr/sqlite_modern_cpp/utility/utf16_utf8.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace sqlite {
1111
struct : std::codecvt<char16_t, char, std::mbstate_t> {
1212
} codecvt;
1313
std::mbstate_t state;
14-
std::string result(std::max(input.size() * 3 / 2, std::size_t(4)), '\0');
14+
std::string result((std::max)(input.size() * 3 / 2, std::size_t(4)), '\0');
1515
const char16_t *remaining_input = input.data();
1616
std::size_t produced_output = 0;
1717
while(true) {
@@ -32,7 +32,7 @@ namespace sqlite {
3232
produced_output = used_output - result.data();
3333
result.resize(
3434
result.size()
35-
+ std::max((&input[input.size()] - remaining_input) * 3 / 2,
35+
+ (std::max)((&input[input.size()] - remaining_input) * 3 / 2,
3636
std::ptrdiff_t(4)));
3737
}
3838
}

0 commit comments

Comments
 (0)