lint: formatting

This commit is contained in:
Tyler Wilding
2024-11-09 13:27:07 -05:00
parent 84e2b768e4
commit c60590a626
3 changed files with 20 additions and 13 deletions
+7 -5
View File
@@ -4,9 +4,10 @@
#include "common/log/log.h"
#ifdef __APPLE__
#include <sys/types.h>
#include <sys/sysctl.h>
#include <stdio.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#endif
#ifdef _WIN32
@@ -112,12 +113,12 @@ CpuInfo& get_cpu_info() {
}
std::optional<double> get_macos_version() {
#ifndef __APPLE__
#ifndef __APPLE__
return {};
#endif
#else
char buffer[128];
size_t bufferlen = 128;
auto ok = sysctlbyname("kern.osproductversion",&buffer,&bufferlen,NULL,0);
auto ok = sysctlbyname("kern.osproductversion", &buffer, &bufferlen, NULL, 0);
if (ok != 0) {
lg::warn("Unable to check for `kern.osproductversion` to determine macOS version");
return {};
@@ -128,4 +129,5 @@ std::optional<double> get_macos_version() {
lg::error("Error occured when attempting to convert sysctl value {} to number", buffer);
return {};
}
#endif
}
+1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <cstddef>
#include <optional>
#include <string>
size_t get_peak_rss();
+12 -8
View File
@@ -179,22 +179,26 @@ int main(int argc, char** argv) {
setup_cpu_info();
// If the CPU doesn't have AVX, GOAL code won't work and we exit.
if (!get_cpu_info().has_avx) {
// Check if we are on a modern enough version of macOS so that AVX can be
// emulated via rosetta
#ifdef __APPLE__
// Check if we are on a modern enough version of macOS so that AVX can be
// emulated via rosetta
#ifdef __APPLE__
auto macos_version = get_macos_version();
if (macos_version < 15.0) {
lg::info("Your CPU does not support AVX. But the newer version of Rosetta supports it, update to atleast Sequoia to run OpenGOAL!");
lg::info(
"Your CPU does not support AVX. But the newer version of Rosetta supports it, update to "
"atleast Sequoia to run OpenGOAL!");
dialogs::create_error_message_dialog(
"Unmet Requirements", "Your CPU does not support AVX. But the newer version of Rosetta supports it, update to atleast Sequoia to run OpenGOAL!");
return -1;
"Unmet Requirements",
"Your CPU does not support AVX. But the newer version of Rosetta supports it, update to "
"atleast Sequoia to run OpenGOAL!");
return -1;
}
#else
#else
lg::info("Your CPU does not support AVX, which is required for OpenGOAL.");
dialogs::create_error_message_dialog(
"Unmet Requirements", "Your CPU does not support AVX, which is required for OpenGOAL.");
return -1;
#endif
#endif
}
// set up file paths for resources. This is the full repository when developing, and the data