summaryrefslogtreecommitdiffstats
path: root/widget/cocoa/GfxInfo.mm
diff options
context:
space:
mode:
Diffstat (limited to 'widget/cocoa/GfxInfo.mm')
-rw-r--r--widget/cocoa/GfxInfo.mm61
1 files changed, 41 insertions, 20 deletions
diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm
index 85c469286..97bb4c832 100644
--- a/widget/cocoa/GfxInfo.mm
+++ b/widget/cocoa/GfxInfo.mm
@@ -30,25 +30,46 @@ GfxInfo::GfxInfo()
}
static OperatingSystem
-OSXVersionToOperatingSystem(uint32_t aOSXVersion)
-{
- if (nsCocoaFeatures::ExtractMajorVersion(aOSXVersion) == 10) {
- switch (nsCocoaFeatures::ExtractMinorVersion(aOSXVersion)) {
- case 6:
- return OperatingSystem::OSX10_6;
- case 7:
- return OperatingSystem::OSX10_7;
- case 8:
- return OperatingSystem::OSX10_8;
- case 9:
- return OperatingSystem::OSX10_9;
- case 10:
- return OperatingSystem::OSX10_10;
- case 11:
- return OperatingSystem::OSX10_11;
- case 12:
- return OperatingSystem::OSX10_12;
- }
+OSXVersionToOperatingSystem(uint32_t aOSXVersion) {
+ switch (nsCocoaFeatures::ExtractMajorVersion(aOSXVersion)) {
+ case 10:
+ switch (nsCocoaFeatures::ExtractMinorVersion(aOSXVersion)) {
+ case 6:
+ return OperatingSystem::OSX10_6;
+ case 7:
+ return OperatingSystem::OSX10_7;
+ case 8:
+ return OperatingSystem::OSX10_8;
+ case 9:
+ return OperatingSystem::OSX10_9;
+ case 10:
+ return OperatingSystem::OSX10_10;
+ case 11:
+ return OperatingSystem::OSX10_11;
+ case 12:
+ return OperatingSystem::OSX10_12;
+ case 13:
+ return OperatingSystem::OSX10_13;
+ case 14:
+ return OperatingSystem::OSX10_14;
+ case 15:
+ return OperatingSystem::OSX10_15;
+ case 16:
+ // Depending on the SDK version, we either get 10.16 or 11.0.
+ // Normalize this to 11.0.
+ return OperatingSystem::OSX11_0;
+ default:
+ break;
+ }
+ break;
+ case 11:
+ switch (nsCocoaFeatures::ExtractMinorVersion(aOSXVersion)) {
+ case 0:
+ return OperatingSystem::OSX11_0;
+ default:
+ break;
+ }
+ break;
}
return OperatingSystem::Unknown;
@@ -107,7 +128,7 @@ GfxInfo::Init()
AddCrashReportAnnotations();
- mOSXVersion = nsCocoaFeatures::OSXVersion();
+ mOSXVersion = nsCocoaFeatures::macOSVersion();
return rv;
}