mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-05 04:46:57 +03:00
NOISSUE add implementations of system query functions
* system memory size in bytes * system architecture is 64bit? * CPU architecture is 64bit?
This commit is contained in:
parent
00c4aebeaa
commit
44805145dc
4 changed files with 105 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "sys.h"
|
||||
|
||||
// FIXME: replace with our version...
|
||||
QString Sys::getSystemInfo()
|
||||
{
|
||||
QSysInfo::MacVersion version = QSysInfo::macVersion();
|
||||
|
|
@ -116,3 +117,31 @@ QString Sys::getSystemInfo()
|
|||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
uint64_t Sys::getSystemRam()
|
||||
{
|
||||
uint64_t memsize;
|
||||
size_t memsizesize = sizeof(memsize);
|
||||
if(!sysctlbyname("hw.memsize", &memsize, &memsizesize, NULL, 0))
|
||||
{
|
||||
return memsize;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool Sys::isCPU64bit()
|
||||
{
|
||||
// not even going to pretend I'm going to support anything else
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Sys::isSystem64bit()
|
||||
{
|
||||
// yep. maybe when we have 128bit CPUs on consumer devices.
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue