diff options
author | Frank Meerkötter <frank.meerkoetter@basyskom.com> | 2020-12-21 18:42:34 +0100 |
---|---|---|
committer | Frank Meerkötter <frank.meerkoetter@basyskom.com> | 2020-12-22 07:33:02 +0100 |
commit | f7a47c74be3c402e5aaa498ebd7c879385512bbc (patch) | |
tree | 2c2dd58404c949bfd412b6256c4119c6b8d2b851 /src | |
parent | 5ec0a29b5d18f6fa67fa6edb8ab6734e36903036 (diff) |
Prevent preprocessor shenanigans on Windows
We already guard against max() being (wrongfully)
being replaced at other places in Qt OPC UA. Not sure we this
one did not cause trouble so far.
Thanks to Alexander Neumann
Task-number: QTBUG-89427
Change-Id: I7906ec1b99401b7fefcfcdab1b0ccd82c999c174
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/opcua/open62541/qopen62541backend.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/opcua/open62541/qopen62541backend.cpp b/src/plugins/opcua/open62541/qopen62541backend.cpp index 42d9f48..91f790d 100644 --- a/src/plugins/opcua/open62541/qopen62541backend.cpp +++ b/src/plugins/opcua/open62541/qopen62541backend.cpp @@ -50,6 +50,7 @@ #include <QtCore/qurl.h> #include <algorithm> +#include <limits> QT_BEGIN_NAMESPACE @@ -1057,11 +1058,11 @@ void Open62541AsyncBackend::reevaluateClientIterateTimer() if (m_subscriptions.count() == 0) m_clientIterateTimer.start(m_maximumIterateInterval); else {// Derive an interval from the the lowest subscription and a lower limit. - double minimum = std::numeric_limits<double>::max(); + double minimum = (std::numeric_limits<double>::max)(); for (const auto subscription : m_subscriptions) minimum = subscription->interval() < minimum ? subscription->interval() : minimum; // Set an interval between configured minimum and maximum, depending on the fastest subscription - m_clientIterateTimer.start(std::min(m_maximumIterateInterval, std::max(m_minimumIterateInterval, minimum))); + m_clientIterateTimer.start((std::min)(m_maximumIterateInterval, (std::max)(m_minimumIterateInterval, minimum))); } } |