Skip to content

Windows stdlib #19739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stdlib/public/SwiftShims/LibcOverlayShims.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static inline int _swift_stdlib_ioctlPtr(int fd, unsigned long int request, void
#if defined(_WIN32) && !defined(__CYGWIN__)
// Windows
static inline int _swift_stdlib_open(const char *path, int oflag, mode_t mode) {
return _open(path, oflag, static_cast<int>(mode));
return _open(path, oflag, (int)mode);
}

#else
Expand All @@ -114,7 +114,7 @@ int static inline _swift_stdlib_openat(int fd, const char *path, int oflag,
}
#endif

static inline ssize_t
static inline __swift_ssize_t
_swift_stdlib_read(int fd, void *buf, size_t nbyte) {
#if defined(_WIN32)
return _read(fd, buf, nbyte);
Expand All @@ -123,7 +123,7 @@ _swift_stdlib_read(int fd, void *buf, size_t nbyte) {
#endif
}

static inline ssize_t
static inline __swift_ssize_t
_swift_stdlib_write(int fd, const void *buf, size_t nbyte) {
#if defined(_WIN32)
return _write(fd, buf, nbyte);
Expand Down
3 changes: 2 additions & 1 deletion stdlib/public/stubs/Random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

#if defined(_WIN32) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Bcrypt.h>
#pragma comment(lib, "Bcrypt.lib")
#pragma comment(lib, "bcrypt.lib")
#else
#include <errno.h>
#include <fcntl.h>
Expand Down