diff options
author | Friedemann Kleint <[email protected]> | 2022-12-20 16:13:43 +0100 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2022-12-22 17:43:32 +0100 |
commit | 469ef8995180df65f1906b6451759ff2a1de0937 (patch) | |
tree | cc773832fa5903024571340d4f26fcc112e47842 | |
parent | 0b1361f4d70ef00e3a10a390f6b87b756f012838 (diff) |
libshiboken: Include windows.h with consistent defines
Otherwise, clashes can occur in CMake UNITY_BUILD (jumbo) builds. Amends
5ef2f78f7d0172683d6ae63314530844c48c548e.
Task-number: PYSIDE-2155
Change-Id: Id0145f687caece83d595756254f8672f9de3a370
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Christian Tismer <[email protected]>
-rw-r--r-- | sources/shiboken6/libshiboken/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/debugfreehook.cpp | 5 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/helper.cpp | 8 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/sbkwindows.h | 17 |
4 files changed, 20 insertions, 11 deletions
diff --git a/sources/shiboken6/libshiboken/CMakeLists.txt b/sources/shiboken6/libshiboken/CMakeLists.txt index 2dd4e86ae..c729f42d8 100644 --- a/sources/shiboken6/libshiboken/CMakeLists.txt +++ b/sources/shiboken6/libshiboken/CMakeLists.txt @@ -164,6 +164,7 @@ install(FILES threadstatesaver.h shibokenbuffer.h sbkpython.h + sbkwindows.h pep384impl.h voidptr.h bufferprocs_py37.h diff --git a/sources/shiboken6/libshiboken/debugfreehook.cpp b/sources/shiboken6/libshiboken/debugfreehook.cpp index ee9434423..13df6bd6c 100644 --- a/sources/shiboken6/libshiboken/debugfreehook.cpp +++ b/sources/shiboken6/libshiboken/debugfreehook.cpp @@ -6,11 +6,8 @@ #include "gilstate.h" #if defined(_WIN32) && defined(_DEBUG) -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif +# include <sbkwindows.h> # include <crtdbg.h> -# include <windows.h> #endif #ifdef __GLIBC__ diff --git a/sources/shiboken6/libshiboken/helper.cpp b/sources/shiboken6/libshiboken/helper.cpp index 378511010..84231f844 100644 --- a/sources/shiboken6/libshiboken/helper.cpp +++ b/sources/shiboken6/libshiboken/helper.cpp @@ -15,13 +15,7 @@ #include <cctype> #ifdef _WIN32 -# ifndef NOMINMAX -# define NOMINMAX -# endif -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include <windows.h> +# include <sbkwindows.h> #else # include <pthread.h> #endif diff --git a/sources/shiboken6/libshiboken/sbkwindows.h b/sources/shiboken6/libshiboken/sbkwindows.h new file mode 100644 index 000000000..9e753fa5e --- /dev/null +++ b/sources/shiboken6/libshiboken/sbkwindows.h @@ -0,0 +1,17 @@ +// Copyright (C) 2022 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 SBKWINDOWS_H +#define SBKWINDOWS_H + +#ifdef _WIN32 +# ifndef NOMINMAX +# define NOMINMAX +# endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include <windows.h> +#endif + +#endif // SBKWINDOWS_H |