Skip to content

Commit 882e2c3

Browse files
committed
Fix the signature of CreateSymbolicLinkW
Closes #12123
1 parent b66ec34 commit 882e2c3

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/libnative/io/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ pub fn symlink(src: &CString, dst: &CString) -> IoResult<()> {
746746
super::mkerr_winbool(as_utf16_p(src.as_str().unwrap(), |src| {
747747
as_utf16_p(dst.as_str().unwrap(), |dst| {
748748
unsafe { libc::CreateSymbolicLinkW(dst, src, 0) }
749-
})
749+
}) as libc::BOOL
750750
}))
751751
}
752752

src/libstd/libc.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ pub mod types {
970970

971971
pub type BOOL = c_int;
972972
pub type BYTE = u8;
973+
pub type BOOLEAN = BYTE;
973974
pub type CCHAR = c_char;
974975
pub type CHAR = c_char;
975976

@@ -3984,15 +3985,16 @@ pub mod funcs {
39843985

39853986
pub mod kernel32 {
39863987
use libc::types::os::arch::c95::{c_uint};
3987-
use libc::types::os::arch::extra::{BOOL, DWORD, SIZE_T, HMODULE};
3988-
use libc::types::os::arch::extra::{LPCWSTR, LPWSTR, LPCSTR, LPSTR, LPCH,
3989-
LPDWORD, LPVOID,
3990-
LPCVOID, LPOVERLAPPED};
3991-
use libc::types::os::arch::extra::{LPSECURITY_ATTRIBUTES, LPSTARTUPINFO,
3988+
use libc::types::os::arch::extra::{BOOL, DWORD, SIZE_T, HMODULE,
3989+
LPCWSTR, LPWSTR, LPCSTR, LPSTR,
3990+
LPCH, LPDWORD, LPVOID,
3991+
LPCVOID, LPOVERLAPPED,
3992+
LPSECURITY_ATTRIBUTES,
3993+
LPSTARTUPINFO,
39923994
LPPROCESS_INFORMATION,
39933995
LPMEMORY_BASIC_INFORMATION,
3994-
LPSYSTEM_INFO};
3995-
use libc::types::os::arch::extra::{HANDLE, LPHANDLE, LARGE_INTEGER,
3996+
LPSYSTEM_INFO, BOOLEAN,
3997+
HANDLE, LPHANDLE, LARGE_INTEGER,
39963998
PLARGE_INTEGER, LPFILETIME};
39973999

39984000
extern "system" {
@@ -4105,7 +4107,7 @@ pub mod funcs {
41054107
dwFlags: DWORD) -> BOOL;
41064108
pub fn CreateSymbolicLinkW(lpSymlinkFileName: LPCWSTR,
41074109
lpTargetFileName: LPCWSTR,
4108-
dwFlags: DWORD) -> BOOL;
4110+
dwFlags: DWORD) -> BOOLEAN;
41094111
pub fn CreateHardLinkW(lpSymlinkFileName: LPCWSTR,
41104112
lpTargetFileName: LPCWSTR,
41114113
lpSecurityAttributes: LPSECURITY_ATTRIBUTES)

0 commit comments

Comments
 (0)