diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index 2f886346c9f..f31cdc92a6d 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -335,8 +335,9 @@ public: template = true> static constexpr bool isValidSegment(Integer segment) { + // using extra parentheses around max to avoid expanding it if it is a macro return segment >= Integer(0) - && (std::numeric_limits::max() < Integer(SegmentUnknown) + && ((std::numeric_limits::max)() < Integer(SegmentUnknown) || segment < Integer(SegmentUnknown)); }