mirror of
https://github.com/vlang/v.git
synced 2025-08-03 09:47:15 -04:00
os,runtime: move some C struct and fn def to builtin
(#24942)
This commit is contained in:
parent
ae0937c83e
commit
5d4e89f888
@ -528,3 +528,15 @@ fn C.WrappedNSLog(str &u8)
|
||||
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
|
||||
|
||||
// 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 {}
|
||||
|
@ -585,15 +585,6 @@ fn get_long_path(path string) !string {
|
||||
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.
|
||||
pub fn page_size() int {
|
||||
sinfo := C.SYSTEM_INFO{}
|
||||
|
@ -8,7 +8,6 @@ pub struct C.MEMORYSTATUS {
|
||||
dwAvailPhys usize
|
||||
}
|
||||
|
||||
fn C.GetSystemInfo(&C.SYSTEM_INFO)
|
||||
fn C.GlobalMemoryStatus(&C.MEMORYSTATUS)
|
||||
|
||||
// nr_cpus returns the number of virtual CPU cores found on the system.
|
||||
|
@ -22,9 +22,6 @@ type MHANDLE = voidptr
|
||||
// Semaphore HANDLE
|
||||
type SHANDLE = voidptr
|
||||
|
||||
@[typedef]
|
||||
pub struct C.SRWLOCK {}
|
||||
|
||||
@[typedef]
|
||||
pub struct C.CONDITION_VARIABLE {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user