diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-22 00:57:15 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-22 02:46:18 +0100 |
commit | 44805145dc385ba9ffe0d78f2e723cef42984537 (patch) | |
tree | ffbb3b8f08258e4627d008ae2b3e1c99860a81b6 /libraries/ganalytics/src/sys_apple.cpp | |
parent | 00c4aebeaafe08d6834c90b097c5018493ee62ec (diff) | |
download | MultiMC-44805145dc385ba9ffe0d78f2e723cef42984537.tar MultiMC-44805145dc385ba9ffe0d78f2e723cef42984537.tar.gz MultiMC-44805145dc385ba9ffe0d78f2e723cef42984537.tar.lz MultiMC-44805145dc385ba9ffe0d78f2e723cef42984537.tar.xz MultiMC-44805145dc385ba9ffe0d78f2e723cef42984537.zip |
NOISSUE add implementations of system query functions
* system memory size in bytes
* system architecture is 64bit?
* CPU architecture is 64bit?
Diffstat (limited to 'libraries/ganalytics/src/sys_apple.cpp')
-rw-r--r-- | libraries/ganalytics/src/sys_apple.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libraries/ganalytics/src/sys_apple.cpp b/libraries/ganalytics/src/sys_apple.cpp index c648970e..f221a527 100644 --- a/libraries/ganalytics/src/sys_apple.cpp +++ b/libraries/ganalytics/src/sys_apple.cpp @@ -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; +} |