1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

macOS: Fix getOperatingSystemType when getOSXVersion returns 11.0 instead of 10.16

This commit is contained in:
reuk 2020-08-24 12:22:59 +01:00
parent a5c86be57a
commit 3ad4835854

View file

@ -137,10 +137,17 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
StringArray parts;
parts.addTokens (getOSXVersion(), ".", StringRef());
const int major = parts[1].getIntValue();
jassert ((parts[0].getIntValue() == 10 && major > 2) || parts[0].getIntValue() == 11);
const auto major = parts[0].getIntValue();
const auto minor = parts[1].getIntValue();
return (OperatingSystemType) (major + MacOSX_10_4 - 4);
if (major == 10)
{
jassert (minor > 2);
return (OperatingSystemType) (minor + MacOSX_10_4 - 4);
}
jassert (major == 11 && minor == 0);
return MacOSX_11_0;
#endif
}