mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 16:48:18 +00:00
Fixed version matching
This commit is contained in:
+15
-8
@@ -914,38 +914,45 @@ gb_internal void report_os_info() {
|
||||
|
||||
// Scan table for match on BUILD
|
||||
int macos_release_count = sizeof(macos_release_map) / sizeof(macos_release_map[0]);
|
||||
Darwin_To_Release match = {};
|
||||
Darwin_To_Release build_match = {};
|
||||
Darwin_To_Release kernel_match = {};
|
||||
|
||||
for (int build = 0; build < macos_release_count; build++) {
|
||||
Darwin_To_Release rel = macos_release_map[build];
|
||||
|
||||
// Do we have an exact match on the BUILD?
|
||||
if (gb_strcmp(rel.build, (const char *)build_buffer) == 0) {
|
||||
match = rel;
|
||||
build_match = rel;
|
||||
break;
|
||||
}
|
||||
|
||||
// Do we have an exact Darwin match?
|
||||
if (rel.darwin[0] == major && rel.darwin[1] == minor && rel.darwin[2] == patch) {
|
||||
match = rel;
|
||||
break;
|
||||
kernel_match = rel;
|
||||
}
|
||||
|
||||
// Major kernel version needs to match exactly,
|
||||
if (rel.darwin[0] == major) {
|
||||
// No major version match yet.
|
||||
if (!match.os_name) {
|
||||
match = rel;
|
||||
if (!kernel_match.os_name) {
|
||||
kernel_match = rel;
|
||||
}
|
||||
if (minor >= rel.darwin[1]) {
|
||||
match = rel;
|
||||
kernel_match = rel;
|
||||
if (patch >= rel.darwin[2]) {
|
||||
match = rel;
|
||||
kernel_match = rel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Darwin_To_Release match = {};
|
||||
if(!build_match.build) {
|
||||
match = kernel_match;
|
||||
} else {
|
||||
match = build_match;
|
||||
}
|
||||
|
||||
if (match.os_name) {
|
||||
gb_printf("%s %s %d", match.os_name, match.release.name, match.release.version[0]);
|
||||
if (match.release.version[1] > 0 || match.release.version[2] > 0) {
|
||||
|
||||
Reference in New Issue
Block a user