diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-04-29 23:32:46 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-04-30 00:24:09 +0200 |
| commit | e896efdaebc3d527732bdfa76ff93496f855df11 (patch) | |
| tree | 682a4f30a48d412e7e372ffef745eca6aff40e28 /core/sys/info | |
| parent | 30cfdd73b0cf6df7bf04f0f17a91fd6450ba7f73 (diff) | |
sys/info: add easy way of getting the MacOS version
Diffstat (limited to 'core/sys/info')
| -rw-r--r-- | core/sys/info/platform_darwin.odin | 2 | ||||
| -rw-r--r-- | core/sys/info/sysinfo.odin | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/core/sys/info/platform_darwin.odin b/core/sys/info/platform_darwin.odin index b95a48bd0..5c69d5cc0 100644 --- a/core/sys/info/platform_darwin.odin +++ b/core/sys/info/platform_darwin.odin @@ -76,6 +76,8 @@ init_os_version :: proc () { os_version.minor = rel.darwin.y os_version.patch = rel.darwin.z + macos_version = transmute(Version)rel.release.version + strings.write_string(&b, rel.os_name) if match == .Exact || match == .Nearest { strings.write_rune(&b, ' ') diff --git a/core/sys/info/sysinfo.odin b/core/sys/info/sysinfo.odin index 69f9f1584..f0262f317 100644 --- a/core/sys/info/sysinfo.odin +++ b/core/sys/info/sysinfo.odin @@ -8,6 +8,9 @@ os_version: OS_Version ram: RAM 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 { Unknown, Windows, @@ -19,12 +22,14 @@ OS_Version_Platform :: enum { NetBSD, } +Version :: struct { + major, minor, patch: int, +} + OS_Version :: struct { platform: OS_Version_Platform, - major: int, - minor: int, - patch: int, + using _: Version, build: [2]int, version: string, @@ -42,4 +47,4 @@ GPU :: struct { vendor_name: string, model_name: string, total_ram: int, -}
\ No newline at end of file +} |