From d4b5c21de74e007e63be19323c02cd7e947399a4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 8 Dec 2023 03:05:20 +0100 Subject: [PATCH] Fix compile-time check for macOS 11 This fixes warnings about MAC_OS_X_VERSION_11_0 not being defined when using older SDKs, as 21da0e128d (Change wxRendererNative to use NSCell-based methods under Mac, 2023-11-12) used a wrong name for the version constant: since macOS 11 these constants don't use "X" in their names any longer. Remove this and add a comment to the place where we define them to document this not quite obvious naming convention. --- include/wx/platform.h | 3 +++ src/osx/cocoa/renderer.mm | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/wx/platform.h b/include/wx/platform.h index b77b5bd86c..8597797767 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -455,6 +455,9 @@ # ifndef MAC_OS_X_VERSION_10_16 # define MAC_OS_X_VERSION_10_16 101600 # endif + /* + Note that since macOS 11 there is no more "X" in the names. + */ # ifndef MAC_OS_VERSION_11_0 # define MAC_OS_VERSION_11_0 110000 # endif diff --git a/src/osx/cocoa/renderer.mm b/src/osx/cocoa/renderer.mm index 1fe4a98b0b..484de678ee 100644 --- a/src/osx/cocoa/renderer.mm +++ b/src/osx/cocoa/renderer.mm @@ -618,7 +618,7 @@ void wxRendererMac::ApplyMacControlFlags(wxWindow* win, NSCell* cell, int flags) size = NSSmallControlSize; else if (win->GetWindowVariant() == wxWINDOW_VARIANT_MINI || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI)) size = NSMiniControlSize; -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_11_0 +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 else if (win->GetWindowVariant() == wxWINDOW_VARIANT_LARGE|| (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_LARGE)) { if (WX_IS_MACOS_AVAILABLE(11, 0))