Skip to content

Commit 6f95d7c

Browse files
committed
[Concurrency][Windows] Add a couple of includes for Windows.
Actor.cpp does need <io.h> still, and Task.cpp should have been including <windows.h> rdar://90776105
1 parent ca926e4 commit 6f95d7c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

stdlib/public/Concurrency/Actor.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919
#include <atomic>
2020
#include <new>
2121

22-
#ifdef _WIN32
23-
// On Windows, an include below triggers an indirect include of minwindef.h
24-
// which contains a definition of the `max` macro, generating an error in our
25-
// use of std::max in this file. This define prevents those macros from being
26-
// defined.
27-
#define NOMINMAX
28-
#endif
29-
3022
#include "../CompatibilityOverride/CompatibilityOverride.h"
3123
#include "swift/Runtime/Atomic.h"
3224
#include "swift/Runtime/AccessibleFunction.h"
@@ -68,6 +60,10 @@
6860
#include <sys/syscall.h>
6961
#endif
7062

63+
#if defined(_WIN32)
64+
#include <io.h>
65+
#endif
66+
7167
#if SWIFT_OBJC_INTEROP
7268
extern "C" void *objc_autoreleasePoolPush();
7369
extern "C" void objc_autoreleasePoolPop(void *);

stdlib/public/Concurrency/Task.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17+
#ifdef _WIN32
18+
#define WIN32_LEAN_AND_MEAN
19+
#define NOMINMAX
20+
#include <windows.h>
21+
#endif
22+
1723
#include "../CompatibilityOverride/CompatibilityOverride.h"
1824
#include "swift/Runtime/Concurrency.h"
1925
#include "swift/ABI/Task.h"

0 commit comments

Comments
 (0)