* Fix#2157
* 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