os,runtime: move some C struct and fn def to builtin (#24942)

This commit is contained in:
kbkpbot 2025-07-22 12:55:53 +08:00 committed by GitHub
parent ae0937c83e
commit 5d4e89f888
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 13 deletions

View File

@ -528,3 +528,15 @@ fn C.WrappedNSLog(str &u8)
fn C.abs(number int) int fn C.abs(number int) int
fn C.GetDiskFreeSpaceExA(const_path &char, free_bytes_available_to_caller &u64, total_number_of_bytes &u64, total_number_of_free_bytes &u64) bool fn C.GetDiskFreeSpaceExA(const_path &char, free_bytes_available_to_caller &u64, total_number_of_bytes &u64, total_number_of_free_bytes &u64) bool
// C.SYSTEM_INFO contains information about the current computer system. This includes the architecture and type of the processor, the number of processors in the system, the page size, and other such information.
@[typedef]
pub struct C.SYSTEM_INFO {
dwNumberOfProcessors u32
dwPageSize u32
}
fn C.GetSystemInfo(&C.SYSTEM_INFO)
@[typedef]
pub struct C.SRWLOCK {}

View File

@ -585,15 +585,6 @@ fn get_long_path(path string) !string {
return long_path return long_path
} }
// C.SYSTEM_INFO contains information about the current computer system. This includes the architecture and type of the processor, the number of processors in the system, the page size, and other such information.
@[typedef]
pub struct C.SYSTEM_INFO {
dwNumberOfProcessors u32
dwPageSize u32
}
fn C.GetSystemInfo(&C.SYSTEM_INFO)
// page_size returns the page size in bytes. // page_size returns the page size in bytes.
pub fn page_size() int { pub fn page_size() int {
sinfo := C.SYSTEM_INFO{} sinfo := C.SYSTEM_INFO{}

View File

@ -8,7 +8,6 @@ pub struct C.MEMORYSTATUS {
dwAvailPhys usize dwAvailPhys usize
} }
fn C.GetSystemInfo(&C.SYSTEM_INFO)
fn C.GlobalMemoryStatus(&C.MEMORYSTATUS) fn C.GlobalMemoryStatus(&C.MEMORYSTATUS)
// nr_cpus returns the number of virtual CPU cores found on the system. // nr_cpus returns the number of virtual CPU cores found on the system.

View File

@ -22,9 +22,6 @@ type MHANDLE = voidptr
// Semaphore HANDLE // Semaphore HANDLE
type SHANDLE = voidptr type SHANDLE = voidptr
@[typedef]
pub struct C.SRWLOCK {}
@[typedef] @[typedef]
pub struct C.CONDITION_VARIABLE {} pub struct C.CONDITION_VARIABLE {}