From 09f32728142b96fef4c7000fd757f0f18cbfaafe Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 4 Mar 2020 15:42:39 +0100 Subject: [PATCH] QTypeRevision: Fix warnings about max macro from windows.h Similar to def272750cdb7810bca4f4815ed1183ba2bd6df9, put parentheses around std::numeric_limits::max, fixing: qversionnumber.h(339): warning C4003: not enough arguments for function-like macro invocation 'max' Change-Id: Id574f3a08973cf1408e015f155c8e658b04bd170 Reviewed-by: Ulf Hermann --- src/corelib/tools/qversionnumber.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)); }