Skip to content

Commit 61831b7

Browse files
committed
Fix Windows build error: wrap std::max in parentheses to avoid macro conflict
- On Windows, max/min are often defined as macros by windows.h - This causes compilation errors with std::max/std::min - Solution: use (std::max) to prevent macro expansion - Fixes CI build error: error C2589: '(': illegal token on right side of '::' Fixes: error in coalesce_ranges function on line 5376
1 parent 3d74978 commit 61831b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

httplib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5373,7 +5373,7 @@ inline void coalesce_ranges(Ranges &ranges, size_t content_length) {
53735373
if (first_pos <= prev.second + 1 &&
53745374
!(first_pos == prev.first && last_pos == prev.second)) {
53755375
// Extend the previous range
5376-
prev.second = std::max(prev.second, last_pos);
5376+
prev.second = (std::max)(prev.second, last_pos);
53775377
continue;
53785378
}
53795379
}

0 commit comments

Comments
 (0)