Skip to content

Commit 9fb7934

Browse files
committed
WinSDK: adjust for 32-bit builds
Due to the type differences between 32-bit and 64-bit, the SDK overlay would fail to build on Windows. This adjusts that to allow building the SDK overlay on 32-bit Windows again.
1 parent 3135b5d commit 9fb7934

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

stdlib/public/Windows/WinSDK.swift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ public let INVALID_SOCKET: SOCKET = SOCKET(bitPattern: -1)
4646
public let FIONBIO: Int32 = Int32(bitPattern: 0x8004667e)
4747

4848
// WinUser.h
49-
public let CW_USEDEFAULT: Int32 = Int32(truncatingIfNeeded: 2147483648)
49+
public let CW_USEDEFAULT: Int32 = Int32(bitPattern: 2147483648)
5050
public let WS_OVERLAPPEDWINDOW: UINT =
5151
UINT(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
5252
public let WS_POPUPWINDOW: UINT =
53-
UINT(Int32(WS_POPUP) | WS_BORDER | WS_SYSMENU)
53+
UINT(numericCast(WS_POPUP) | WS_BORDER | WS_SYSMENU)
5454

5555
// fileapi.h
5656
public let INVALID_FILE_ATTRIBUTES: DWORD = DWORD(bitPattern: -1)
@@ -91,16 +91,17 @@ public let DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED: DPI_AWARENESS_CONTEXT =
9191
DPI_AWARENESS_CONTEXT(bitPattern: -5)!
9292

9393
// winreg.h
94-
public let HKEY_CLASSES_ROOT: HKEY = HKEY(bitPattern: 0x80000000)!
95-
public let HKEY_CURRENT_USER: HKEY = HKEY(bitPattern: 0x80000001)!
96-
public let HKEY_LOCAL_MACHINE: HKEY = HKEY(bitPattern: 0x80000002)!
97-
public let HKEY_USERS: HKEY = HKEY(bitPattern: 0x80000003)!
98-
public let HKEY_PERFORMANCE_DATA: HKEY = HKEY(bitPattern: 0x80000004)!
99-
public let HKEY_PERFORMANCE_TEXT: HKEY = HKEY(bitPattern: 0x80000050)!
100-
public let HKEY_PERFORMANCE_NLSTEXT: HKEY = HKEY(bitPattern: 0x80000060)!
101-
public let HKEY_CURRENT_CONFIG: HKEY = HKEY(bitPattern: 0x80000005)!
102-
public let HKEY_DYN_DATA: HKEY = HKEY(bitPattern: 0x80000006)!
103-
public let HKEY_CURRENT_USER_LOCAL_SETTINGS: HKEY = HKEY(bitPattern: 0x80000007)!
94+
public let HKEY_CLASSES_ROOT: HKEY = HKEY(bitPattern: UInt(0x80000000))!
95+
public let HKEY_CURRENT_USER: HKEY = HKEY(bitPattern: UInt(0x80000001))!
96+
public let HKEY_LOCAL_MACHINE: HKEY = HKEY(bitPattern: UInt(0x80000002))!
97+
public let HKEY_USERS: HKEY = HKEY(bitPattern: UInt(0x80000003))!
98+
public let HKEY_PERFORMANCE_DATA: HKEY = HKEY(bitPattern: UInt(0x80000004))!
99+
public let HKEY_PERFORMANCE_TEXT: HKEY = HKEY(bitPattern: UInt(0x80000050))!
100+
public let HKEY_PERFORMANCE_NLSTEXT: HKEY = HKEY(bitPattern: UInt(0x80000060))!
101+
public let HKEY_CURRENT_CONFIG: HKEY = HKEY(bitPattern: UInt(0x80000005))!
102+
public let HKEY_DYN_DATA: HKEY = HKEY(bitPattern: UInt(0x80000006))!
103+
public let HKEY_CURRENT_USER_LOCAL_SETTINGS: HKEY =
104+
HKEY(bitPattern: UInt(0x80000007))!
104105

105106
// Richedit.h
106107
public let MSFTEDIT_CLASS: [WCHAR] = Array<WCHAR>("RICHEDIT50W".utf16)

0 commit comments

Comments
 (0)