Summary
The nightly Windows CI build fails when Thrift 0.13.0 is compiled against Boost 1.83.0. The error originates in boost/locale/util/string.hpp which was introduced in Boost 1.83.0 and calls std::numeric_limits<char>::max() inside a constexpr function.
Failing job: https://github.com/hazelcast/hazelcast-cpp-client/actions/runs/26226738709/job/77175714903
Configuration: Windows · Boost 1.83.0 · Debug · noSSL
Error
C:\Boost\include\boost-1_83\boost\locale\util\string.hpp(41,66): error C2589: '(': illegal token on right side of '::'
C:\Boost\include\boost-1_83\boost\locale\util\string.hpp(41,66): error C2059: syntax error: ')'
C:\Boost\include\boost-1_83\boost\locale\util\string.hpp(39,20): error C3615: constexpr function 'boost::locale::util::to_char' cannot result in a constant expression
(compiling source file '../../../lib/cpp/src/thrift/protocol/TJSONProtocol.cpp')
Root Cause
On Windows, windows.h defines min and max as macros unless NOMINMAX is defined beforehand. Boost 1.83.0 added boost/locale/util/string.hpp which contains:
constexpr char to_char(int c) noexcept {
return (c >= 0 && c <= std::numeric_limits<char>::max()) ? ...;
}
Because Thrift 0.13.0 does not define NOMINMAX globally, the max macro corrupts this call at the preprocessor level, causing the C2589/C2059/C3615 errors.
Fix
Pass /DNOMINMAX via CMAKE_CXX_FLAGS when configuring the Thrift CMake build in the Windows CI action. This is a safe, idiomatic Windows fix that defines NOMINMAX before any header is processed and does not affect other configurations.
Summary
The nightly Windows CI build fails when Thrift 0.13.0 is compiled against Boost 1.83.0. The error originates in
boost/locale/util/string.hppwhich was introduced in Boost 1.83.0 and callsstd::numeric_limits<char>::max()inside aconstexprfunction.Failing job: https://github.com/hazelcast/hazelcast-cpp-client/actions/runs/26226738709/job/77175714903
Configuration: Windows · Boost 1.83.0 · Debug · noSSL
Error
Root Cause
On Windows,
windows.hdefinesminandmaxas macros unlessNOMINMAXis defined beforehand. Boost 1.83.0 addedboost/locale/util/string.hppwhich contains:Because Thrift 0.13.0 does not define
NOMINMAXglobally, themaxmacro corrupts this call at the preprocessor level, causing the C2589/C2059/C3615 errors.Fix
Pass
/DNOMINMAXviaCMAKE_CXX_FLAGSwhen configuring the Thrift CMake build in the Windows CI action. This is a safe, idiomatic Windows fix that definesNOMINMAXbefore any header is processed and does not affect other configurations.