mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-30 19:30:06 +00:00
sys/info: add easy way of getting the MacOS version
This commit is contained in:
@@ -76,6 +76,8 @@ init_os_version :: proc () {
|
|||||||
os_version.minor = rel.darwin.y
|
os_version.minor = rel.darwin.y
|
||||||
os_version.patch = rel.darwin.z
|
os_version.patch = rel.darwin.z
|
||||||
|
|
||||||
|
macos_version = transmute(Version)rel.release.version
|
||||||
|
|
||||||
strings.write_string(&b, rel.os_name)
|
strings.write_string(&b, rel.os_name)
|
||||||
if match == .Exact || match == .Nearest {
|
if match == .Exact || match == .Nearest {
|
||||||
strings.write_rune(&b, ' ')
|
strings.write_rune(&b, ' ')
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ os_version: OS_Version
|
|||||||
ram: RAM
|
ram: RAM
|
||||||
gpus: []GPU
|
gpus: []GPU
|
||||||
|
|
||||||
|
// Only on MacOS, contains the actual MacOS version, while the `os_version` contains the kernel version.
|
||||||
|
macos_version: Version
|
||||||
|
|
||||||
OS_Version_Platform :: enum {
|
OS_Version_Platform :: enum {
|
||||||
Unknown,
|
Unknown,
|
||||||
Windows,
|
Windows,
|
||||||
@@ -19,12 +22,14 @@ OS_Version_Platform :: enum {
|
|||||||
NetBSD,
|
NetBSD,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Version :: struct {
|
||||||
|
major, minor, patch: int,
|
||||||
|
}
|
||||||
|
|
||||||
OS_Version :: struct {
|
OS_Version :: struct {
|
||||||
platform: OS_Version_Platform,
|
platform: OS_Version_Platform,
|
||||||
|
|
||||||
major: int,
|
using _: Version,
|
||||||
minor: int,
|
|
||||||
patch: int,
|
|
||||||
build: [2]int,
|
build: [2]int,
|
||||||
version: string,
|
version: string,
|
||||||
|
|
||||||
@@ -42,4 +47,4 @@ GPU :: struct {
|
|||||||
vendor_name: string,
|
vendor_name: string,
|
||||||
model_name: string,
|
model_name: string,
|
||||||
total_ram: int,
|
total_ram: int,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user