Add "stdcall" as synonym for "c-stack-stdcall"

This commit is contained in:
Brian Anderson 2011-11-09 16:02:21 -08:00
parent 1afc943c91
commit e96342820d
4 changed files with 5 additions and 3 deletions

View File

@ -2012,6 +2012,8 @@ fn parse_item_native_mod(p: parser, attrs: [ast::attribute]) -> @ast::item {
abi = ast::native_abi_cdecl; abi = ast::native_abi_cdecl;
} else if str::eq(t, "c-stack-stdcall") { } else if str::eq(t, "c-stack-stdcall") {
abi = ast::native_abi_stdcall; abi = ast::native_abi_stdcall;
} else if str::eq(t, "stdcall") {
abi = ast::native_abi_stdcall;
} else { } else {
p.fatal("unsupported abi: " + t); p.fatal("unsupported abi: " + t);
} }

View File

@ -408,7 +408,7 @@ fn print_item(s: ps, &&item: @ast::item) {
word_nbsp(s, "\"c-stack-cdecl\""); word_nbsp(s, "\"c-stack-cdecl\"");
} }
ast::native_abi_stdcall. { ast::native_abi_stdcall. {
word_nbsp(s, "\"c-stack-stdcall\""); word_nbsp(s, "\"stdcall\"");
} }
} }
word_nbsp(s, "mod"); word_nbsp(s, "mod");

View File

@ -2,7 +2,7 @@
// xfail-test // xfail-test
#[cfg(target_os = "win32")] #[cfg(target_os = "win32")]
native "c-stack-stdcall" mod kernel32 { native "stdcall" mod kernel32 {
fn SetLastError(err: uint); fn SetLastError(err: uint);
fn GetLastError() -> uint; fn GetLastError() -> uint;
} }

View File

@ -5,7 +5,7 @@ type LPVOID = uint;
type BOOL = u8; type BOOL = u8;
#[cfg(target_os = "win32")] #[cfg(target_os = "win32")]
native "c-stack-stdcall" mod kernel32 { native "stdcall" mod kernel32 {
fn GetProcessHeap() -> HANDLE; fn GetProcessHeap() -> HANDLE;
fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID; fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID;
fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL; fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL;