SystemStats::getOperatingSystemType assertion fails on macOS 11.1

Apple just released macOS 11.1 (which should hopefully fix all the problems on my M1), and this breaks an implicit assumption by juce::SystemStats::getOperatingSystemType - which the update was expected to be a 11.0.X (Apple stayed on version 10 for two decades, are they going to jump version every year now?).

Everyone is likely to hit this assertion as the constructor of juce::TopLevelWindow happens to call it.

Suggested fix at https://github.com/soundradix/JUCE/commit/d35ca96c50772c767c2e8c0a9f80173c78fc213a,

Note how it also renames juce::SystemStats::MacOSX_11_0 to juce::SystemStats::MacOSX_11 to reflect this naming scheme shift by Apple.

3 Likes

In case such renaming is considered generally, shouldn’t it be named MacOS_11 (without the X) then to really reflect the naming of the operating system? :wink:

2 Likes

True! Possibly too late for the macOS 10 constants because old user code may have them, but certainly for the new one!

Thanks for raising this, I’ve fixed the assertion and updated the naming:

2 Likes

perhaps
MacOS = 0x0100,
MacOSX = MacOS, // deprecated

though officially its macOS, so might be better if new names reflect this too?
so

macOS = 0x0100,
MacOSX = macOS, // deprecated

macOS_11 = macOS | 16,

btw: 11.1 is now released.
I guess we will see a few new releases in relatively quick succession)

(I didnt think the MACOSX_10 was that bad, given X=10 :wink: )