mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-07-10 13:29:52 -04:00
rbutilqt: Switch to a Qt API to get the CPU cores count
This removes usage of the deprecated macOS Gestalt() API (1/2) Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com> Change-Id: Ia3af510412a97258dcd9fc9134708900c04c62c4
This commit is contained in:
parent
cac0be6af5
commit
1cbf61607e
1 changed files with 2 additions and 6 deletions
|
|
@ -179,14 +179,10 @@ QString System::osVersionString(void)
|
|||
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
|
||||
struct utsname u;
|
||||
int ret;
|
||||
int cores;
|
||||
ret = uname(&u);
|
||||
cores = QThread::idealThreadCount();
|
||||
|
||||
#if defined(Q_OS_MACOS)
|
||||
SInt32 cores;
|
||||
Gestalt(gestaltCountOfCPUs, &cores);
|
||||
#else
|
||||
long cores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#endif
|
||||
if(ret != -1) {
|
||||
result = QString("CPU: %1, %2 processor(s)").arg(u.machine).arg(cores);
|
||||
result += QString("<br/>System: %2<br/>Release: %3<br/>Version: %4")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue