Skip to content

Commit aef7596

Browse files
Move the windows.h include back.
1 parent d66ca37 commit aef7596

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

Include/internal/condvar.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
/* include windows if it hasn't been done before */
3434
#define WIN32_LEAN_AND_MEAN
35+
#include <windows.h>
3536

3637
/* options */
3738
/* non-emulated condition variables are provided for those that want
@@ -49,7 +50,7 @@
4950

5051
#if _PY_EMULATED_WIN_CV
5152

52-
typedef struct CRITICAL_SECTION PyMUTEX_T;
53+
typedef CRITICAL_SECTION PyMUTEX_T;
5354

5455
/* The ConditionVariable object. From XP onwards it is easily emulated
5556
with a Semaphore.
@@ -68,16 +69,20 @@ typedef struct CRITICAL_SECTION PyMUTEX_T;
6869
that would otherwise happen.
6970
*/
7071

71-
typedef struct _PyCOND_T PyCOND_T;
72+
typedef struct _PyCOND_T
73+
{
74+
HANDLE sem;
75+
int waiting; /* to allow PyCOND_SIGNAL to be a no-op */
76+
} PyCOND_T;
7277

7378
#else /* !_PY_EMULATED_WIN_CV */
7479

7580
/* Use native Win7 primitives if build target is Win7 or higher */
7681

7782
/* SRWLOCK is faster and better than CriticalSection */
78-
typedef struct SRWLOCK PyMUTEX_T;
83+
typedef SRWLOCK PyMUTEX_T;
7984

80-
typedef struct CONDITION_VARIABLE PyCOND_T;
85+
typedef CONDITION_VARIABLE PyCOND_T;
8186

8287
#endif /* _PY_EMULATED_WIN_CV */
8388

Python/condvar.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, long long us)
104104
* example native support on VISTA and onwards.
105105
*/
106106

107-
#include <windows.h>
108-
109107
#if _PY_EMULATED_WIN_CV
110108

111109
/* The mutex is a CriticalSection object and
@@ -123,12 +121,6 @@ PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, long long us)
123121
http://www.cse.wustl.edu/~schmidt/win32-cv-1.html
124122
*/
125123

126-
struct _PyCOND_T
127-
{
128-
HANDLE sem;
129-
int waiting; /* to allow PyCOND_SIGNAL to be a no-op */
130-
};
131-
132124
Py_LOCAL_INLINE(int)
133125
PyMUTEX_INIT(PyMUTEX_T *cs)
134126
{

0 commit comments

Comments
 (0)