RFR: 8374522: Mobile: Add iOS as a platform in OperatingSystem.java

Magnus Ihse Bursie ihse at openjdk.org
Sun Feb 1 22:48:40 UTC 2026


On Tue, 6 Jan 2026 11:06:16 GMT, Johan Vos <jvos at openjdk.org> wrote:

>> I don't know how but Kotlin calls OperatingSystem.IOS, adding iOS as an OperatingSystem fixed my problems, it had something to do with Kotlin's logging library if I remember correctly during initialization it calls something with OperatingSystem.IOS then it panics because IOS isn't an option in the OperatingSystem Class
>
> src/java.base/share/classes/jdk/internal/util/OperatingSystem.java line 106:
> 
>> 104:     @ForceInline
>> 105:     public static boolean isMacOS() {
>> 106:         // Treat iOS as macOS for compatibility with existing libraries unless specific IOS checks exist
> 
> I don't think this is needed once the isIOS() call is added? (which is added in this PR)

Also, it looks really odd.  Why isn't it something like:

return current() == MACOS || current() == IOS;

or 

return PlatformProps.TARGET_OS_IS_MACOS || PlatformProps.TARGET_OS_IS_IOS;

?

-------------

PR Review Comment: https://git.openjdk.org/mobile/pull/44#discussion_r2668189797


More information about the mobile-dev mailing list