# SystemStats::getOperatingSystemType assertion fails on macOS 11.1

**URL:** <https://forum.juce.com/t/systemstats-getoperatingsystemtype-assertion-fails-on-macos-11-1/43251>\
**Category:** MacOSX and iOS\
**Created:** [December 15, 2020, 9:31am UTC](https://forum.juce.com/t/systemstats-getoperatingsystemtype-assertion-fails-on-macos-11-1/43251 "2020-12-15T09:31:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 15, 2020, 9:31am UTC](https://forum.juce.com/t/systemstats-getoperatingsystemtype-assertion-fails-on-macos-11-1/43251/1 "2020-12-15T09:31:54Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![PluginPenguin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pluginpenguin/32/10203_2.png) [@PluginPenguin](https://forum.juce.com/u/PluginPenguin)\
**Post date:** [December 15, 2020, 11:03am UTC](https://forum.juce.com/t/systemstats-getoperatingsystemtype-assertion-fails-on-macos-11-1/43251/2 "2020-12-15T11:03:56Z")

</div>

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? 😉

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 15, 2020, 12:31pm UTC](https://forum.juce.com/t/systemstats-getoperatingsystemtype-assertion-fails-on-macos-11-1/43251/3 "2020-12-15T12:31:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [December 16, 2020, 10:43am UTC](https://forum.juce.com/t/systemstats-getoperatingsystemtype-assertion-fails-on-macos-11-1/43251/4 "2020-12-16T10:43:44Z")

</div>

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

> <https://github.com/juce-framework/JUCE/commit/dc3e0d1571681abf74d2dd08ba02a00d963d80de>

---

<div class="post-metadata">

**Author:** ![thetechnobear](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thetechnobear/32/704_2.png) [@thetechnobear](https://forum.juce.com/u/thetechnobear)\
**Post date:** [December 16, 2020, 2:47pm UTC](https://forum.juce.com/t/systemstats-getoperatingsystemtype-assertion-fails-on-macos-11-1/43251/5 "2020-12-16T14:47:21Z")

</div>

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 😉 )
