]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044)
authorMax Bachmann <kontakt@maxbachmann.de>
Tue, 11 Mar 2025 11:33:01 +0000 (12:33 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Mar 2025 11:33:01 +0000 (12:33 +0100)
* Add missing guards for WIN32_LEAN_AND_MEAN

* add missing whitespaces

Include/internal/pycore_condvar.h
Include/internal/pycore_semaphore.h
Modules/_interpchannelsmodule.c
Modules/_io/winconsoleio.c
Python/lock.c
Python/sysmodule.c

index ee9533484e80488cb55e921c197fba6147fb8176..55271f0a4116ba03fe5314751adb2cb4e0067a6c 100644 (file)
@@ -31,7 +31,9 @@
 #define Py_HAVE_CONDVAR
 
 /* include windows if it hasn't been done before */
-#define WIN32_LEAN_AND_MEAN
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
 #include <windows.h>              // CRITICAL_SECTION
 
 /* options */
index ffcc6d80344d6ea2fc36ec462d74bb81269613d5..269538384606ce1b031a75f928038e253c5efce4 100644 (file)
@@ -10,7 +10,9 @@
 #include "pycore_pythread.h"      // _POSIX_SEMAPHORES
 
 #ifdef MS_WINDOWS
-#   define WIN32_LEAN_AND_MEAN
+#   ifndef WIN32_LEAN_AND_MEAN
+#       define WIN32_LEAN_AND_MEAN
+#   endif
 #   include <windows.h>
 #elif defined(HAVE_PTHREAD_H)
 #   include <pthread.h>
index fc54277cdc0ba04c64c169f1c39c045861834bfa..ae64037d56cac094a271fcadb3fcafec467455e4 100644 (file)
@@ -11,7 +11,9 @@
 #include "pycore_pystate.h"       // _PyInterpreterState_GetIDObject()
 
 #ifdef MS_WINDOWS
-#define WIN32_LEAN_AND_MEAN
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
 #include <windows.h>        // SwitchToThread()
 #elif defined(HAVE_SCHED_H)
 #include <sched.h>          // sched_yield()
index 27c320ed073103c106ab1f3ea6599745ec42fcb4..3f137fa1f5412587d7dabb6eaec1fe69d427fb6a 100644 (file)
@@ -23,7 +23,7 @@
 #include <stddef.h> /* For offsetof */
 
 #ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
 #endif
 #include <windows.h>
 #include <fcntl.h>
index 554c51d7780322499e1a0e46cdfdacefafc3469d..f2067ee2cd5f37a76973f3039752ea49757f231e 100644 (file)
@@ -8,7 +8,9 @@
 #include "pycore_time.h"          // _PyTime_Add()
 
 #ifdef MS_WINDOWS
-#  define WIN32_LEAN_AND_MEAN
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
 #  include <windows.h>            // SwitchToThread()
 #elif defined(HAVE_SCHED_H)
 #  include <sched.h>              // sched_yield()
index 8030bbbdeafd52ae8e8beec48c2b6ea3d9f435ca..adaa5ee1c74aa593b7c1b3064e05bf0f1e453488 100644 (file)
@@ -45,7 +45,9 @@ Data members:
 #endif
 
 #ifdef MS_WINDOWS
-#  define WIN32_LEAN_AND_MEAN
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
 #  include <windows.h>
 #endif /* MS_WINDOWS */