Skip to content

Commit 1a11cf5

Browse files
committed
A couple of Win32 fixes.
rdar://103071801
1 parent 7d651d5 commit 1a11cf5

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

include/swift/Threading/Impl/Win32/Win32Defs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ typedef struct _RTL_CONDITION_VARIABLE *PRTL_CONDITION_VARIABLE;
4747
typedef PRTL_CONDITION_VARIABLE PCONDITION_VARIABLE;
4848

4949
// These have to be #defines, to avoid problems with <windows.h>
50-
#define RTL_SRWLOCK_INIT \
51-
{ 0 }
50+
#define RTL_SRWLOCK_INIT {0}
5251
#define SRWLOCK_INIT RTL_SRWLOCK_INIT
5352
#define FLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
5453

stdlib/public/runtime/Win32.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ swift::_swift_wideFromUTF8(const char *str) {
6868
}
6969

7070
result = reinterpret_cast<wchar_t *>(std::malloc(len * sizeof(wchar_t)));
71-
if (!reuslt) {
71+
if (!result) {
7272
swift::fatalError(0, "unable to allocate space to convert '%s': %d\n",
7373
str, errno);
7474
}
@@ -85,6 +85,4 @@ swift::_swift_wideFromUTF8(const char *str) {
8585
return result;
8686
}
8787

88-
} // namespace swift
89-
9088
#endif // defined(_WIN32)

test/Runtime/Paths.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <string.h>
2121

2222
#if defined(_WIN32) && !defined(__CYGWIN)
23-
#define stat(x) _stat(x)
23+
#define stat(p,s) _stat(p,s)
2424
#define S_IFDIR _S_IFDIR
2525
#endif
2626

0 commit comments

Comments
 (0)