diff options
author | Amir Masoud Abdol <[email protected]> | 2023-05-23 15:04:17 +0200 |
---|---|---|
committer | Amir Masoud Abdol <[email protected]> | 2023-06-08 01:18:04 +0200 |
commit | 1dfa922606e497918e57a6a06f96ee63b7fb163e (patch) | |
tree | 37058b862a9ba496f3330aba57183123ba132ea2 | |
parent | 076b4bed9f418f97f9fb29fce4f948f0d98854c1 (diff) |
Remove the manual undef of the min/max macros, or def NOMINMAX
We now add NOMINMAX to PlatformCommonInternal target which will be
linked to everything else, so min/max will not be defined upon the
inclusion of `windows.h`, or other headers.
Pick-to: 6.5 6.6
Change-Id: I10016720dac7ce015e929885b7368ee86d8b6918
Reviewed-by: Alexandru Croitor <[email protected]>
-rw-r--r-- | src/network/socket/qnativesocketengine_win.cpp | 3 | ||||
-rw-r--r-- | src/plugins/sqldrivers/oci/qsql_oci.cpp | 7 | ||||
-rw-r--r-- | src/plugins/tls/openssl/qdtls_openssl.cpp | 4 | ||||
-rw-r--r-- | src/testlib/qjunittestlogger.cpp | 7 | ||||
-rw-r--r-- | src/testlib/qplaintestlogger.cpp | 7 | ||||
-rw-r--r-- | tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp | 3 | ||||
-rw-r--r-- | tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp | 2 | ||||
-rw-r--r-- | tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 2 |
8 files changed, 0 insertions, 35 deletions
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index d578e5230fd..16d974a68be 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -2,9 +2,6 @@ // Copyright (C) 2016 Intel Corporation. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -// Prevent windows system header files from defining min/max as macros. -#define NOMINMAX 1 - #include <winsock2.h> #include <ws2tcpip.h> diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp index b670efc15be..1a9eb041b30 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci.cpp +++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp @@ -30,14 +30,7 @@ #define _int64 __int64 #endif - #include <oci.h> -#ifdef max -#undef max -#endif -#ifdef min -#undef min -#endif #include <stdlib.h> diff --git a/src/plugins/tls/openssl/qdtls_openssl.cpp b/src/plugins/tls/openssl/qdtls_openssl.cpp index 78288d8dd1b..fc07a29ec86 100644 --- a/src/plugins/tls/openssl/qdtls_openssl.cpp +++ b/src/plugins/tls/openssl/qdtls_openssl.cpp @@ -1,10 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef NOMINMAX -#define NOMINMAX -#endif // NOMINMAX - #include <QtNetwork/private/qnativesocketengine_p_p.h> #include "qsslsocket_openssl_symbols_p.h" diff --git a/src/testlib/qjunittestlogger.cpp b/src/testlib/qjunittestlogger.cpp index 8e2b917055c..4ee5788beea 100644 --- a/src/testlib/qjunittestlogger.cpp +++ b/src/testlib/qjunittestlogger.cpp @@ -9,13 +9,6 @@ #include <QtTest/private/qbenchmark_p.h> #include <QtTest/private/qtestlog_p.h> -#ifdef min // windows.h without NOMINMAX is included by the benchmark headers. -# undef min -#endif -#ifdef max -# undef max -#endif - #include <QtCore/qlibraryinfo.h> #include <string.h> diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index 9f61004c2ce..4bafacb10fa 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -16,13 +16,6 @@ #include <stdlib.h> #include <string.h> -#ifdef min // windows.h without NOMINMAX is included by the benchmark headers. -# undef min -#endif -#ifdef max -# undef max -#endif - #include <QtCore/QByteArray> #include <QtCore/qmath.h> #include <QtCore/QLibraryInfo> diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp index 273bf3a0357..e6704c36236 100644 --- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp @@ -7,9 +7,6 @@ // (except qglobal.h), or else you'll get tons of compile errors #include <qglobal.h> -// To prevent windows system header files from re-defining min/max -#define NOMINMAX 1 - #if defined(Q_OS_WIN) # include <winsock2.h> # include <ws2tcpip.h> diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp index 90e6f3da8e4..f42d0497fef 100644 --- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -2,8 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include <qglobal.h> -// To prevent windows system header files from re-defining min/max -#define NOMINMAX 1 #if defined(_WIN32) #include <winsock2.h> #else diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index 5dc12b924fb..c16717e95a7 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -4,8 +4,6 @@ #include <qglobal.h> -// To prevent windows system header files from re-defining min/max -#define NOMINMAX 1 #if defined(_WIN32) #include <winsock2.h> #else |