in JetBrains.HabitatDetector/src/Impl/MacOsX/MacOsHelper.cs [51:86]
internal static unsafe Version GetOSVersion(JetArchitecture processArchitecture)
{
var processInfo = LibObjC.objc_msgSend(LibObjC.objc_getClass("NSProcessInfo"), LibObjC.sel_getUid("processInfo"));
var operationSystemVersionUid = LibObjC.sel_getUid("operatingSystemVersion");
LibObjC.NSOperatingSystemVersion res;
switch (processArchitecture)
{
case JetArchitecture.Arm64:
res = LibObjC.NSOperatingSystemVersion_objc_msgSend(processInfo, operationSystemVersionUid);
break;
case JetArchitecture.X64:
LibObjC.NSOperatingSystemVersion_objc_msgSend_stret(out res, processInfo, operationSystemVersionUid);
break;
default:
throw new ArgumentOutOfRangeException(nameof(processArchitecture), processArchitecture, null);
}
int major;
int minor;
int patch;
checked
{
major = (int)res.majorVersion;
minor = (int)res.minorVersion;
patch = (int)res.patchVersion;
}
// Note(ww898): Compatibility with older software! See also SYSTEM_VERSION_COMPAT=1. Big Sur and newer OSes always returns 10.16!!!
if (major == 10 && minor == 16)
{
major = 11;
minor = 0;
}
return new Version(major, minor, patch);
}