Skip to content

Register new snapshots #10408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 1 addition & 110 deletions src/libstd/libc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3387,8 +3387,7 @@ pub mod funcs {
LPSYSTEM_INFO};
use libc::types::os::arch::extra::{HANDLE, LPHANDLE};

#[cfg(target_arch = "x86")]
extern "stdcall" {
extern "system" {
pub fn GetEnvironmentVariableW(n: LPCWSTR,
v: LPWSTR,
nsize: DWORD)
Expand Down Expand Up @@ -3494,114 +3493,6 @@ pub mod funcs {
-> LPVOID;
pub fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
}

#[cfg(target_arch = "x86_64")]
extern {
pub fn GetEnvironmentVariableW(n: LPCWSTR,
v: LPWSTR,
nsize: DWORD)
-> DWORD;
pub fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
-> BOOL;
pub fn GetEnvironmentStringsA() -> LPTCH;
pub fn FreeEnvironmentStringsA(env_ptr: LPTCH) -> BOOL;
pub fn GetModuleFileNameW(hModule: HMODULE,
lpFilename: LPWSTR,
nSize: DWORD)
-> DWORD;
pub fn CreateDirectoryW(lpPathName: LPCWSTR,
lpSecurityAttributes:
LPSECURITY_ATTRIBUTES)
-> BOOL;
pub fn CopyFileW(lpExistingFileName: LPCWSTR,
lpNewFileName: LPCWSTR,
bFailIfExists: BOOL)
-> BOOL;
pub fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
pub fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
pub fn GetCurrentDirectoryW(nBufferLength: DWORD,
lpBuffer: LPWSTR)
-> DWORD;
pub fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL;
pub fn GetLastError() -> DWORD;
pub fn FindFirstFileW(fileName: *u16, findFileData: HANDLE)
-> HANDLE;
pub fn FindNextFileW(findFile: HANDLE, findFileData: HANDLE)
-> BOOL;
pub fn FindClose(findFile: HANDLE) -> BOOL;
pub fn DuplicateHandle(hSourceProcessHandle: HANDLE,
hSourceHandle: HANDLE,
hTargetProcessHandle: HANDLE,
lpTargetHandle: LPHANDLE,
dwDesiredAccess: DWORD,
bInheritHandle: BOOL,
dwOptions: DWORD)
-> BOOL;
pub fn CloseHandle(hObject: HANDLE) -> BOOL;
pub fn OpenProcess(dwDesiredAccess: DWORD,
bInheritHandle: BOOL,
dwProcessId: DWORD)
-> HANDLE;
pub fn GetCurrentProcess() -> HANDLE;
pub fn CreateProcessA(lpApplicationName: LPCTSTR,
lpCommandLine: LPTSTR,
lpProcessAttributes:
LPSECURITY_ATTRIBUTES,
lpThreadAttributes:
LPSECURITY_ATTRIBUTES,
bInheritHandles: BOOL,
dwCreationFlags: DWORD,
lpEnvironment: LPVOID,
lpCurrentDirectory: LPCTSTR,
lpStartupInfo: LPSTARTUPINFO,
lpProcessInformation:
LPPROCESS_INFORMATION)
-> BOOL;
pub fn WaitForSingleObject(hHandle: HANDLE,
dwMilliseconds: DWORD)
-> DWORD;
pub fn TerminateProcess(hProcess: HANDLE, uExitCode: c_uint)
-> BOOL;
pub fn GetExitCodeProcess(hProcess: HANDLE,
lpExitCode: LPDWORD)
-> BOOL;
pub fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
pub fn VirtualAlloc(lpAddress: LPVOID,
dwSize: SIZE_T,
flAllocationType: DWORD,
flProtect: DWORD)
-> LPVOID;
pub fn VirtualFree(lpAddress: LPVOID,
dwSize: SIZE_T,
dwFreeType: DWORD)
-> BOOL;
pub fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T) -> BOOL;
pub fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T)
-> BOOL;
pub fn VirtualProtect(lpAddress: LPVOID,
dwSize: SIZE_T,
flNewProtect: DWORD,
lpflOldProtect: LPDWORD)
-> BOOL;
pub fn VirtualQuery(lpAddress: LPCVOID,
lpBuffer: LPMEMORY_BASIC_INFORMATION,
dwLength: SIZE_T)
-> SIZE_T;
pub fn CreateFileMappingW(hFile: HANDLE,
lpAttributes: LPSECURITY_ATTRIBUTES,
flProtect: DWORD,
dwMaximumSizeHigh: DWORD,
dwMaximumSizeLow: DWORD,
lpName: LPCTSTR)
-> HANDLE;
pub fn MapViewOfFile(hFileMappingObject: HANDLE,
dwDesiredAccess: DWORD,
dwFileOffsetHigh: DWORD,
dwFileOffsetLow: DWORD,
dwNumberOfBytesToMap: SIZE_T)
-> LPVOID;
pub fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
}
}

pub mod msvcrt {
Expand Down
48 changes: 6 additions & 42 deletions src/libstd/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,15 +615,8 @@ pub fn errno() -> uint {
#[fixed_stack_segment]; #[inline(never)];
use libc::types::os::arch::extra::DWORD;

#[cfg(target_arch = "x86")]
#[link_name = "kernel32"]
extern "stdcall" {
fn GetLastError() -> DWORD;
}

#[cfg(target_arch = "x86_64")]
#[link_name = "kernel32"]
extern {
extern "system" {
fn GetLastError() -> DWORD;
}

Expand Down Expand Up @@ -693,22 +686,8 @@ pub fn last_os_error() -> ~str {
use libc::types::os::arch::extra::LPVOID;
use libc::types::os::arch::extra::WCHAR;

#[cfg(target_arch = "x86")]
#[link_name = "kernel32"]
extern "stdcall" {
fn FormatMessageW(flags: DWORD,
lpSrc: LPVOID,
msgId: DWORD,
langId: DWORD,
buf: LPWSTR,
nsize: DWORD,
args: *c_void)
-> DWORD;
}

#[cfg(target_arch = "x86_64")]
#[link_name = "kernel32"]
extern {
extern "system" {
fn FormatMessageW(flags: DWORD,
lpSrc: LPVOID,
msgId: DWORD,
Expand Down Expand Up @@ -833,31 +812,16 @@ fn real_args() -> ~[~str] {

type LPCWSTR = *u16;

#[cfg(windows, target_arch = "x86")]
#[cfg(windows)]
#[link_name="kernel32"]
#[abi="stdcall"]
extern "stdcall" {
extern "system" {
fn GetCommandLineW() -> LPCWSTR;
fn LocalFree(ptr: *c_void);
}

#[cfg(windows, target_arch = "x86_64")]
#[link_name="kernel32"]
extern {
fn GetCommandLineW() -> LPCWSTR;
fn LocalFree(ptr: *c_void);
}

#[cfg(windows, target_arch = "x86")]
#[link_name="shell32"]
#[abi="stdcall"]
extern "stdcall" {
fn CommandLineToArgvW(lpCmdLine: LPCWSTR, pNumArgs: *mut c_int) -> **u16;
}

#[cfg(windows, target_arch = "x86_64")]
#[cfg(windows)]
#[link_name="shell32"]
extern {
extern "system" {
fn CommandLineToArgvW(lpCmdLine: LPCWSTR, pNumArgs: *mut c_int) -> **u16;
}

Expand Down
12 changes: 2 additions & 10 deletions src/libstd/rt/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,8 @@ impl Drop for Thread {
}
}

#[cfg(windows, target_arch = "x86")]
extern "stdcall" {
fn CreateThread(lpThreadAttributes: LPSECURITY_ATTRIBUTES, dwStackSize: SIZE_T,
lpStartAddress: extern "C" fn(*libc::c_void) -> rust_thread_return,
lpParameter: LPVOID, dwCreationFlags: DWORD, lpThreadId: LPDWORD) -> HANDLE;
fn WaitForSingleObject(hHandle: HANDLE, dwMilliseconds: DWORD) -> DWORD;
}

#[cfg(windows, target_arch = "x86_64")]
extern {
#[cfg(windows)]
extern "system" {
fn CreateThread(lpThreadAttributes: LPSECURITY_ATTRIBUTES, dwStackSize: SIZE_T,
lpStartAddress: extern "C" fn(*libc::c_void) -> rust_thread_return,
lpParameter: LPVOID, dwCreationFlags: DWORD, lpThreadId: LPDWORD) -> HANDLE;
Expand Down
15 changes: 2 additions & 13 deletions src/libstd/rt/thread_local_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ pub unsafe fn get(key: Key) -> *mut c_void {
TlsGetValue(key)
}

#[cfg(windows, target_arch = "x86")]
extern "stdcall" {
#[cfg(windows)]
extern "system" {
fn TlsAlloc() -> DWORD;

// See the reasoning in pthread_getspecific as to why this has the
Expand All @@ -101,17 +101,6 @@ extern "stdcall" {
fn TlsSetValue(dwTlsIndex: DWORD, lpTlsvalue: LPVOID) -> BOOL;
}

#[cfg(windows, target_arch = "x86_64")]
extern {
fn TlsAlloc() -> DWORD;

// See above.
#[rust_stack]
fn TlsGetValue(dwTlsIndex: DWORD) -> LPVOID;
#[rust_stack]
fn TlsSetValue(dwTlsIndex: DWORD, lpTlsvalue: LPVOID) -> BOOL;
}

#[test]
fn tls_smoke_test() {
use cast::transmute;
Expand Down
14 changes: 1 addition & 13 deletions src/libstd/unstable/dynamic_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,8 @@ pub mod dl {
FreeLibrary(handle); ()
}

#[cfg(target_arch = "x86")]
#[link_name = "kernel32"]
extern "stdcall" {
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);
}

#[cfg(target_arch = "x86_64")]
#[link_name = "kernel32"]
extern {
extern "system" {
fn SetLastError(error: u32);
fn LoadLibraryW(name: *u16) -> *libc::c_void;
fn GetModuleHandleExW(dwFlags: libc::DWORD, name: *u16,
Expand Down
8 changes: 8 additions & 0 deletions src/snapshots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
S 2013-11-10 b5e602a
freebsd-x86_64 bdcfcfa63216559765b83fe4056abb953da25da0
linux-i386 0fb5cdff8a46e9a02bcdba100803bb5504b6f332
linux-x86_64 fe861214208cacef085bfc13c22ce655c207facc
macos-i386 83d7853554e5d5404227924cc3cbf86c673f4626
macos-x86_64 27a71031d9030057746199a3c82efac8f8607093
winnt-i386 d1a0e2a3cfbc09e360aa0ac4f47b3e8a638b39f7

S 2013-11-06 fdc830d
freebsd-x86_64 ef38f3acf8d05eda3c9f21e75c2bbd2f90a614a3
linux-i386 6ad20f6722c15a71fe7654d187dc431e26c1da6f
Expand Down
11 changes: 4 additions & 7 deletions src/test/run-pass/x86stdcall2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ pub type SIZE_T = u32;
pub type LPVOID = uint;
pub type BOOL = u8;

#[cfg(target_os = "win32")]
#[cfg(windows)]
mod kernel32 {
use super::{HANDLE, DWORD, SIZE_T, LPVOID, BOOL};

extern "stdcall" {
extern "system" {
pub fn GetProcessHeap() -> HANDLE;
pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T)
-> LPVOID;
Expand All @@ -27,7 +27,7 @@ mod kernel32 {
}


#[cfg(target_os = "win32")]
#[cfg(windows)]
#[fixed_stack_segment]
pub fn main() {
let heap = unsafe { kernel32::GetProcessHeap() };
Expand All @@ -37,8 +37,5 @@ pub fn main() {
assert!(res != 0u8);
}

#[cfg(target_os = "macos")]
#[cfg(target_os = "linux")]
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "android")]
#[cfg(not(windows))]
pub fn main() { }