]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (GH-131044) (#131084)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 11 Mar 2025 11:56:54 +0000 (12:56 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Mar 2025 11:56:54 +0000 (11:56 +0000)
(cherry picked from commit de8818ae233b8e7722aa5d6f91d4b5a04bd039df)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
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 5dc032b46cac9afbe630b3b1dac8c3398ef554d9..7f812d9eac69e83da98244adcea1ada64e1fc8c3 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 75c61d7ad3c4536f45741678779e8d2a2080e022..6e97403ba1400b1e7d1397f285fa7e1559e71569 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 57675fe1873fa284dd3a051bc6be424d45a269b5..49f46ea36f72acb44ad9e0012a62cf8cdbb8ca35 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 5095d7bdb55a1c62025bade479c0c9dcff51e3d2..80d1bf3b914e37f87e052bbf314848609bae24c0 100644 (file)
@@ -44,7 +44,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 */