Skip to content

Commit 5d4e89f

Browse files
authored
os,runtime: move some C struct and fn def to builtin (#24942)
1 parent ae0937c commit 5d4e89f

4 files changed

Lines changed: 12 additions & 13 deletions

File tree

‎vlib/builtin/cfns.c.v‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,3 +528,15 @@ fn C.WrappedNSLog(str &u8)
528528
fn C.abs(number int) int
529529

530530
fn C.GetDiskFreeSpaceExA(const_path &char, free_bytes_available_to_caller &u64, total_number_of_bytes &u64, total_number_of_free_bytes &u64) bool
531+
532+
// 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.
533+
@[typedef]
534+
pub struct C.SYSTEM_INFO {
535+
dwNumberOfProcessors u32
536+
dwPageSize u32
537+
}
538+
539+
fn C.GetSystemInfo(&C.SYSTEM_INFO)
540+
541+
@[typedef]
542+
pub struct C.SRWLOCK {}

‎vlib/os/os_windows.c.v‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -585,15 +585,6 @@ fn get_long_path(path string) !string {
585585
return long_path
586586
}
587587

588-
// 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.
589-
@[typedef]
590-
pub struct C.SYSTEM_INFO {
591-
dwNumberOfProcessors u32
592-
dwPageSize u32
593-
}
594-
595-
fn C.GetSystemInfo(&C.SYSTEM_INFO)
596-
597588
// page_size returns the page size in bytes.
598589
pub fn page_size() int {
599590
sinfo := C.SYSTEM_INFO{}

‎vlib/runtime/runtime_windows.c.v‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pub struct C.MEMORYSTATUS {
88
dwAvailPhys usize
99
}
1010

11-
fn C.GetSystemInfo(&C.SYSTEM_INFO)
1211
fn C.GlobalMemoryStatus(&C.MEMORYSTATUS)
1312

1413
// nr_cpus returns the number of virtual CPU cores found on the system.

‎vlib/sync/sync_windows.c.v‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ type MHANDLE = voidptr
2222
// Semaphore HANDLE
2323
type SHANDLE = voidptr
2424

25-
@[typedef]
26-
pub struct C.SRWLOCK {}
27-
2825
@[typedef]
2926
pub struct C.CONDITION_VARIABLE {}
3027

0 commit comments

Comments
 (0)