diff options
author | Amir Masoud Abdol <[email protected]> | 2023-05-23 15:04:17 +0200 |
---|---|---|
committer | Amir Masoud Abdol <[email protected]> | 2023-06-08 10:00:52 +0000 |
commit | b101fdadc94b6a53eca02dce10715c8afb1f85ac (patch) | |
tree | 7f8f3262d09735e80aeb338d9e2d17119c74a5d1 | |
parent | 45327d3d43a1ca5e5d485c2902b9f2e7569fc95e (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.
Change-Id: I10016720dac7ce015e929885b7368ee86d8b6918
Reviewed-by: Alexandru Croitor <[email protected]>
(cherry picked from commit 1dfa922606e497918e57a6a06f96ee63b7fb163e)
-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 584c895d643..75cff5c42db 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 8ae8ecf707d..c3258d1e86c 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 748bd00643b..6284c210f25 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 3564e52917d..1a5cff65765 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 75c2af4bdf8..d871d62c0da 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 0f43be07d39..73d1bad81c6 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 |