Skip to content

Commit f377282

Browse files
Map version for Tahoe compatibility. (#116641)
macOS Tahoe returns a compatibility version, 16, for macOS 26 unless it is built with Xcode 26's SDK. As we did with Big Sur, this maps the compatibility version 16 to 26. The intention is that we will be on the new SDK by the time macOS 27 rolls out. If not, then we will need to add another compatibility map, most likely. It does not appear that iOS, tvOS, or Catalyst return compatibility numbers, so they are excluded from doing any mapping. Co-authored-by: Kevin Jones <[email protected]>
1 parent db6f174 commit f377282

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@ internal static Version GetOperatingSystemVersion()
4646
}
4747
}
4848

49-
if (major == 10 && minor == 16)
49+
#if TARGET_OSX
50+
if (major == 16)
5051
{
51-
// We get "compat" version for 11.0 unless we build with updated SDK.
52-
// Hopefully that will be before 11.x comes out
53-
// For now, this maps 10.16 to 11.0.
54-
major = 11;
55-
minor = 0;
52+
// MacOS Tahoe returns a compatibility version unless it is built with a new SDK. Map the compatibility
53+
// version to the "correct" version. This assumes the minor versions will map unchanged.
54+
// 16.0 => 26.0
55+
// 16.1 => 26.1
56+
// etc
57+
major = 26;
5658
}
59+
#endif
5760

5861
return new Version(major, minor, patch);
5962
}

0 commit comments

Comments
 (0)