Support x86 stdcall convention

This allows rust to call the Win32 API
This commit is contained in:
Brian Anderson 2011-07-18 13:14:33 -07:00
parent 682875929e
commit c40d6265ce
7 changed files with 61 additions and 6 deletions

View file

@ -221,6 +221,7 @@ fn parse_ty(@pstate st, str_def sd) -> ty::t {
case ('i') { abi = ast::native_abi_rust_intrinsic; }
case ('c') { abi = ast::native_abi_cdecl; }
case ('l') { abi = ast::native_abi_llvm; }
case ('s') { abi = ast::native_abi_x86stdcall; }
}
auto func = parse_ty_fn(st, sd);
ret ty::mk_native_fn(st.tcx, abi, func._0, func._1);

View file

@ -155,6 +155,7 @@ fn enc_sty(&ioivec::writer w, &@ctxt cx, &ty::sty st) {
}
case (native_abi_cdecl) { w.write_char('c'); }
case (native_abi_llvm) { w.write_char('l'); }
case (native_abi_x86stdcall) { w.write_char('s'); }
}
enc_ty_fn(w, cx, args, out, return, ~[]);
}