8000 [3.13] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (GH-1310… · python/cpython@f9d19a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f9d19a3

Browse files
[3.13] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (GH-131044) (#131084)
(cherry picked from commit de8818a) Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
1 parent 27fd328 commit f9d19a3

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

Include/internal/pycore_condvar.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
#define Py_HAVE_CONDVAR
3232

3333
/* include windows if it hasn't been done before */
34-
#define WIN32_LEAN_AND_MEAN
34+
#ifndef WIN32_LEAN_AND_MEAN
35+
# define WIN32_LEAN_AND_MEAN
36+
#endif
3537
#include <windows.h> // CRITICAL_SECTION
3638

3739
/* options */

Include/internal/pycore_semaphore.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
#include "pycore_pythread.h" // _POSIX_SEMAPHORES
1111

1212
#ifdef MS_WINDOWS
13-
# define WIN32_LEAN_AND_MEAN
13+
# ifndef WIN32_LEAN_AND_MEAN
14+
# define WIN32_LEAN_AND_MEAN
15+
# endif
1416
# include <windows.h>
1517
#elif defined(HAVE_PTHREAD_H)
1618
# include <pthread.h>

Modules/_interpchannelsmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#include "pycore_pystate.h" // _PyInterpreterState_GetIDObject()
1212

1313
#ifdef MS_WINDOWS
14-
#define WIN32_LEAN_AND_MEAN
14+
#ifndef WIN32_LEAN_AND_MEAN
15+
# define WIN32_LEAN_AND_MEAN
16+
#endif
1517
#include <windows.h> // SwitchToThread()
1618
#elif defined(HAVE_SCHED_H)
1719
#include <sched.h> // sched_yield()

Modules/_io/winconsoleio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <stddef.h> /* For offsetof */
2424

2525
#ifndef WIN32_LEAN_AND_MEAN
26-
#define WIN32_LEAN_AND_MEAN
26+
# define WIN32_LEAN_AND_MEAN
2727
#endif
2828
#include <windows.h>
2929
#include <fcntl.h>

Python/lock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
#include "pycore_time.h" // _PyTime_Add()
99

1010
#ifdef MS_WINDOWS
11-
# define WIN32_LEAN_AND_MEAN
11+
# ifndef WIN32_LEAN_AND_MEAN
12+
# define WIN32_LEAN_AND_MEAN
13+
# endif
1214
# include <windows.h> // SwitchToThread()
1315
#elif defined(HAVE_SCHED_H)
1416
# include <sched.h> // sched_yield()

Python/sysmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Data members:
4444
#endif
4545

4646
#ifdef MS_WINDOWS
47-
# define WIN32_LEAN_AND_MEAN
47+
# ifndef WIN32_LEAN_AND_MEAN
48+
# define WIN32_LEAN_AND_MEAN
49+
# endif
4850
# include <windows.h>
4951
#endif /* MS_WINDOWS */
5052

0 commit comments

Comments
 (0)
0