Skip to content

Commit 35c03ac

Browse files
authored
Merge pull request #19739 from compnerd/windows-stdlib
Windows stdlib
2 parents bd41bb7 + 68ec9d4 commit 35c03ac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

stdlib/public/SwiftShims/LibcOverlayShims.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static inline int _swift_stdlib_ioctlPtr(int fd, unsigned long int request, void
9999
#if defined(_WIN32) && !defined(__CYGWIN__)
100100
// Windows
101101
static inline int _swift_stdlib_open(const char *path, int oflag, mode_t mode) {
102-
return _open(path, oflag, static_cast<int>(mode));
102+
return _open(path, oflag, (int)mode);
103103
}
104104

105105
#else
@@ -114,7 +114,7 @@ int static inline _swift_stdlib_openat(int fd, const char *path, int oflag,
114114
}
115115
#endif
116116

117-
static inline ssize_t
117+
static inline __swift_ssize_t
118118
_swift_stdlib_read(int fd, void *buf, size_t nbyte) {
119119
#if defined(_WIN32)
120120
return _read(fd, buf, nbyte);
@@ -123,7 +123,7 @@ _swift_stdlib_read(int fd, void *buf, size_t nbyte) {
123123
#endif
124124
}
125125

126-
static inline ssize_t
126+
static inline __swift_ssize_t
127127
_swift_stdlib_write(int fd, const void *buf, size_t nbyte) {
128128
#if defined(_WIN32)
129129
return _write(fd, buf, nbyte);

stdlib/public/stubs/Random.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919

2020
#if defined(_WIN32) && !defined(__CYGWIN__)
2121
#define WIN32_LEAN_AND_MEAN
22+
#include <Windows.h>
2223
#include <Bcrypt.h>
23-
#pragma comment(lib, "Bcrypt.lib")
24+
#pragma comment(lib, "bcrypt.lib")
2425
#else
2526
#include <errno.h>
2627
#include <fcntl.h>

0 commit comments

Comments
 (0)