mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-16 03:38:38 +12:00
Implement proper macOS version check (#11352)
This commit is contained in:
parent
0d1c0e72a6
commit
ef66b002e0
3 changed files with 45 additions and 0 deletions
|
@ -12,9 +12,11 @@
|
|||
#else
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#ifndef __APPLE__
|
||||
#include <sys/utsname.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "util/asm.hpp"
|
||||
|
||||
|
@ -47,6 +49,16 @@ inline u64 utils::get_xgetbv(u32 xcr)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// sysinfo_darwin.mm
|
||||
namespace Darwin_Version
|
||||
{
|
||||
extern int getNSmajorVersion();
|
||||
extern int getNSminorVersion();
|
||||
extern int getNSpatchVersion();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool utils::has_ssse3()
|
||||
{
|
||||
static const bool g_value = get_cpuid(0, 0)[0] >= 0x1 && get_cpuid(1, 0)[2] & 0x200;
|
||||
|
@ -343,6 +355,13 @@ std::string utils::get_OS_version()
|
|||
fmt::append(output,
|
||||
"Operating system: Windows, Major: %lu, Minor: %lu, Build: %u, Service Pack: %s, Compatibility mode: %llu",
|
||||
version_major, version_minor, build, has_sp ? holder.data() : "none", compatibility_mode);
|
||||
#elif defined (__APPLE__)
|
||||
const int major_version = Darwin_Version::getNSmajorVersion();
|
||||
const int minor_version = Darwin_Version::getNSminorVersion();
|
||||
const int patch_version = Darwin_Version::getNSpatchVersion();
|
||||
|
||||
fmt::append(output, "Operating system: macOS, Version: %d.%d.%d",
|
||||
major_version, minor_version, patch_version);
|
||||
#else
|
||||
struct utsname details = {};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue