summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2016-03-20 11:13:48 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2016-03-27 12:38:17 +0200
commit32aaa52ed4f9d34339d09bc9f83a762151c0702d (patch)
tree051434b9f107f72667e9008a025b778b85051f51 /rbutil/rbutilqt
parent8624392f7ecb6c3126d1bd84c6857a2986a0fa08 (diff)
downloadrockbox-32aaa52ed4f9d34339d09bc9f83a762151c0702d.tar.gz
rockbox-32aaa52ed4f9d34339d09bc9f83a762151c0702d.tar.bz2
rockbox-32aaa52ed4f9d34339d09bc9f83a762151c0702d.zip
Use Gestalt to get number of CPUs on OS X.
MPProcessors has been deprecated with 10.7. When targeting 10.7 (required when building with Qt 5.6 on OS X) this causes a warning. Use Gestalt instead (Gestalt has been deprecated with 10.8, but when targeting 10.7 this doesn't cause a warning, and Gestalt is used for other values as well). Change-Id: Iaf82147ad47115e228f5c08f8198a6a7e92102a3
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r--rbutil/rbutilqt/base/system.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/rbutil/rbutilqt/base/system.cpp b/rbutil/rbutilqt/base/system.cpp
index 3e3f18fd81..55e92908ab 100644
--- a/rbutil/rbutilqt/base/system.cpp
+++ b/rbutil/rbutilqt/base/system.cpp
@@ -186,7 +186,8 @@ QString System::osVersionString(void)
ret = uname(&u);
#if defined(Q_OS_MACX)
- ItemCount cores = MPProcessors();
+ SInt32 cores;
+ Gestalt(gestaltCountOfCPUs, &cores);
#else
long cores = sysconf(_SC_NPROCESSORS_ONLN);
#endif
@@ -202,28 +203,27 @@ QString System::osVersionString(void)
SInt32 major;
SInt32 minor;
SInt32 bugfix;
- OSErr error;
- error = Gestalt(gestaltSystemVersionMajor, &major);
- error = Gestalt(gestaltSystemVersionMinor, &minor);
- error = Gestalt(gestaltSystemVersionBugFix, &bugfix);
+ Gestalt(gestaltSystemVersionMajor, &major);
+ Gestalt(gestaltSystemVersionMinor, &minor);
+ Gestalt(gestaltSystemVersionBugFix, &bugfix);
result += QString("<br/>OS X %1.%2.%3 ").arg(major).arg(minor).arg(bugfix);
// 1: 86k, 2: ppc, 10: i386
SInt32 arch;
- error = Gestalt(gestaltSysArchitecture, &arch);
+ Gestalt(gestaltSysArchitecture, &arch);
switch(arch) {
case 1:
- result.append("(86k)");
- break;
- case 2:
- result.append("(ppc)");
- break;
- case 10:
- result.append("(x86)");
- break;
- default:
- result.append("(unknown)");
- break;
+ result.append("(86k)");
+ break;
+ case 2:
+ result.append("(ppc)");
+ break;
+ case 10:
+ result.append("(x86)");
+ break;
+ default:
+ result.append("(unknown)");
+ break;
}
#endif
#endif