Skip to content

Commit 365f68f

Browse files
authored
Merge pull request #162 from compnerd/ambiguous
TSCBasic: repair the Windows build
2 parents 58a3ddb + 173756d commit 365f68f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/TSCBasic/Lock.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ public final class FileLock {
9696
switch type {
9797
case .exclusive:
9898
if !LockFileEx(handle, DWORD(LOCKFILE_EXCLUSIVE_LOCK), 0,
99-
DWORD(INT_MAX), DWORD(INT_MAX), &overlapped) {
99+
UInt32.max, UInt32.max, &overlapped) {
100100
throw ProcessLockError.unableToAquireLock(errno: Int32(GetLastError()))
101101
}
102102
case .shared:
103103
if !LockFileEx(handle, 0, 0,
104-
DWORD(INT_MAX), DWORD(INT_MAX), &overlapped) {
104+
UInt32.max, UInt32.max, &overlapped) {
105105
throw ProcessLockError.unableToAquireLock(errno: Int32(GetLastError()))
106106
}
107107
}
@@ -135,7 +135,7 @@ public final class FileLock {
135135
overlapped.Offset = 0
136136
overlapped.OffsetHigh = 0
137137
overlapped.hEvent = nil
138-
UnlockFileEx(handle, 0, DWORD(INT_MAX), DWORD(INT_MAX), &overlapped)
138+
UnlockFileEx(handle, 0, UInt32.max, UInt32.max, &overlapped)
139139
#else
140140
guard let fd = fileDescriptor else { return }
141141
flock(fd, LOCK_UN)

0 commit comments

Comments
 (0)