Skip to content

Commit 87d3a1d

Browse files
committed
os.filelock: compile without warnings with gcc on windows
1 parent b76b1ee commit 87d3a1d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎vlib/os/filelock/lib.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import time
55
pub struct FileLock {
66
name string
77
mut:
8-
fd int
8+
fd i64
99
}
1010

1111
pub fn new(fileName string) FileLock {

‎vlib/os/filelock/lib_windows.c.v‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ pub fn (mut l FileLock) acquire() ! {
2121
if fd == -1 {
2222
return error_with_code('cannot create lock file ${l.name}', -1)
2323
}
24-
l.fd = int(fd)
24+
l.fd = fd
2525
}
2626

27-
fn open(f string) voidptr {
27+
fn open(f string) i64 {
2828
f_wide := f.to_wide()
2929
// locking it
3030
fd := C.CreateFileW(f_wide, C.GENERIC_READ | C.GENERIC_WRITE, 0, 0, C.OPEN_ALWAYS,
3131
C.FILE_ATTRIBUTE_NORMAL, 0)
32-
return fd
32+
return i64(fd)
3333
}
3434

3535
pub fn (mut l FileLock) try_acquire() bool {
@@ -41,6 +41,6 @@ pub fn (mut l FileLock) try_acquire() bool {
4141
if fd == -1 {
4242
return false
4343
}
44-
l.fd = int(fd)
44+
l.fd = fd
4545
return true
4646
}

0 commit comments

Comments
 (0)