diff options
| author | klutzy <klutzytheklutzy@gmail.com> | 2013-08-12 15:27:46 +0900 |
|---|---|---|
| committer | klutzy <klutzytheklutzy@gmail.com> | 2013-08-26 22:15:45 +0900 |
| commit | 05b6a2f59c8efa0605db3f5d8f5ef554cb35ff74 (patch) | |
| tree | bee06074fc13f9987282722381c8c241b38ba377 /src/libstd/unstable | |
| parent | 6aff4c67f607a38bc4d95e132fe40563e7422beb (diff) | |
| download | rust-05b6a2f59c8efa0605db3f5d8f5ef554cb35ff74.tar.gz rust-05b6a2f59c8efa0605db3f5d8f5ef554cb35ff74.zip | |
std: Add Win64 support
Some extern blobs are duplicated without "stdcall" abi, since Win64 does not use any calling convention. (Giving any abi to them causes llvm producing wrong bytecode.)
Diffstat (limited to 'src/libstd/unstable')
| -rw-r--r-- | src/libstd/unstable/dynamic_lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstd/unstable/dynamic_lib.rs b/src/libstd/unstable/dynamic_lib.rs index 6dbe68200b3..90cf49cad1c 100644 --- a/src/libstd/unstable/dynamic_lib.rs +++ b/src/libstd/unstable/dynamic_lib.rs @@ -252,6 +252,7 @@ mod dl { FreeLibrary(handle); () } + #[cfg(target_arch = "x86")] #[link_name = "kernel32"] extern "stdcall" { fn SetLastError(error: u32); @@ -261,4 +262,15 @@ mod dl { fn GetProcAddress(handle: *libc::c_void, name: *libc::c_char) -> *libc::c_void; fn FreeLibrary(handle: *libc::c_void); } + + #[cfg(target_arch = "x86_64")] + #[link_name = "kernel32"] + extern { + fn SetLastError(error: u32); + fn LoadLibraryW(name: *u16) -> *libc::c_void; + fn GetModuleHandleExW(dwFlags: libc::DWORD, name: *u16, + handle: **libc::c_void) -> *libc::c_void; + fn GetProcAddress(handle: *libc::c_void, name: *libc::c_char) -> *libc::c_void; + fn FreeLibrary(handle: *libc::c_void); + } } |
