From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 11 Mar 2025 11:56:54 +0000 (+0100) Subject: [3.13] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (GH-131044) (#131084) X-Git-Tag: v3.13.3~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9d19a3ada63b9e9ec457d7b8f42c57b830280b4;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (GH-131044) (#131084) (cherry picked from commit de8818ae233b8e7722aa5d6f91d4b5a04bd039df) Co-authored-by: Max Bachmann --- diff --git a/Include/internal/pycore_condvar.h b/Include/internal/pycore_condvar.h index ee9533484e80..55271f0a4116 100644 --- a/Include/internal/pycore_condvar.h +++ b/Include/internal/pycore_condvar.h @@ -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 // CRITICAL_SECTION /* options */ diff --git a/Include/internal/pycore_semaphore.h b/Include/internal/pycore_semaphore.h index ffcc6d80344d..269538384606 100644 --- a/Include/internal/pycore_semaphore.h +++ b/Include/internal/pycore_semaphore.h @@ -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 #elif defined(HAVE_PTHREAD_H) # include diff --git a/Modules/_interpchannelsmodule.c b/Modules/_interpchannelsmodule.c index 5dc032b46cac..7f812d9eac69 100644 --- a/Modules/_interpchannelsmodule.c +++ b/Modules/_interpchannelsmodule.c @@ -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 // SwitchToThread() #elif defined(HAVE_SCHED_H) #include // sched_yield() diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index 75c61d7ad3c4..6e97403ba140 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -23,7 +23,7 @@ #include /* For offsetof */ #ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN #endif #include #include diff --git a/Python/lock.c b/Python/lock.c index 57675fe1873f..49f46ea36f72 100644 --- a/Python/lock.c +++ b/Python/lock.c @@ -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 // SwitchToThread() #elif defined(HAVE_SCHED_H) # include // sched_yield() diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 5095d7bdb55a..80d1bf3b914e 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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 #endif /* MS_WINDOWS */