mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
reorganize comments for shim's classification
This commit is contained in:
@@ -104,6 +104,7 @@ fn emulate_foreign_item_by_name(
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// Other shims
|
||||
"posix_memalign" => {
|
||||
let ret = this.deref_operand(args[0])?;
|
||||
let align = this.read_scalar(args[1])?.to_machine_usize(this)?;
|
||||
|
||||
@@ -40,6 +40,7 @@ fn emulate_foreign_item_by_name(
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// Other shims
|
||||
"pthread_getattr_np" => {
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ fn emulate_foreign_item_by_name(
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// macOS API stubs.
|
||||
// Other shims
|
||||
"pthread_attr_get_np" => {
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,11 @@ fn emulate_foreign_item_by_name(
|
||||
let tcx = &{ this.tcx.tcx };
|
||||
|
||||
match link_name {
|
||||
// Windows API stubs.
|
||||
// HANDLE = isize
|
||||
// DWORD = ULONG = u32
|
||||
// BOOL = i32
|
||||
|
||||
// Environment related shims
|
||||
"GetEnvironmentVariableW" => {
|
||||
// args[0] : LPCWSTR lpName (32-bit ptr to a const string of 16-bit Unicode chars)
|
||||
@@ -70,10 +75,8 @@ fn emulate_foreign_item_by_name(
|
||||
dest,
|
||||
)?;
|
||||
}
|
||||
// Windows API stubs.
|
||||
// HANDLE = isize
|
||||
// DWORD = ULONG = u32
|
||||
// BOOL = i32
|
||||
|
||||
// Other shims
|
||||
"GetProcessHeap" => {
|
||||
// Just fake a HANDLE
|
||||
this.write_scalar(Scalar::from_int(1, this.pointer_size()), dest)?;
|
||||
|
||||
Reference in New Issue
Block a user