diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qversionnumber.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index 2f886346c9..f31cdc92a6 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -335,8 +335,9 @@ public: template<typename Integer, if_valid_segment_type<Integer> = 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<Integer>::max() < Integer(SegmentUnknown) + && ((std::numeric_limits<Integer>::max)() < Integer(SegmentUnknown) || segment < Integer(SegmentUnknown)); } |