From b716ff5b975b7cda1b35f8aceba8bcbb2f919fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 2 Feb 2022 22:49:55 +0100 Subject: [PATCH] Cocoa: Clarify comments on compatibility macros (cherry picked from commit 97da62a027794d9ff0f4512268cb9a73a8fb5073) --- src/cocoa_platform.h | 11 +++++++++-- src/nsgl_context.h | 6 ++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/cocoa_platform.h b/src/cocoa_platform.h index abeca53c..bb677033 100644 --- a/src/cocoa_platform.h +++ b/src/cocoa_platform.h @@ -42,8 +42,10 @@ typedef void* id; #endif // NOTE: Many Cocoa enum values have been renamed and we need to build across -// SDK versions where one is unavailable or the other deprecated -// We use the newer names in code and these macros to handle compatibility +// SDK versions where one is unavailable or deprecated. +// We use the newer names in code and replace them with the older names if +// the base SDK does not provide the newer names. + #if MAC_OS_X_VERSION_MAX_ALLOWED < 101200 #define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat #define NSEventMaskAny NSAnyEventMask @@ -62,6 +64,11 @@ typedef void* id; #define NSWindowStyleMaskTitled NSTitledWindowMask #endif +// NOTE: Many Cocoa dynamically linked constants have been renamed and we need +// to build across SDK versions where one is unavailable or deprecated. +// We use the newer names in code and replace them with the older names if +// the deployment target is older than the newer names. + #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 #define NSPasteboardTypeURL NSURLPboardType #endif diff --git a/src/nsgl_context.h b/src/nsgl_context.h index be77e7b5..010ce4dc 100644 --- a/src/nsgl_context.h +++ b/src/nsgl_context.h @@ -25,8 +25,10 @@ //======================================================================== // NOTE: Many Cocoa enum values have been renamed and we need to build across -// SDK versions where one is unavailable or the other deprecated -// We use the newer names in code and these macros to handle compatibility +// SDK versions where one is unavailable or deprecated. +// We use the newer names in code and replace them with the older names if +// the base SDK does not provide the newer names. + #if MAC_OS_X_VERSION_MAX_ALLOWED < 101400 #define NSOpenGLContextParameterSwapInterval NSOpenGLCPSwapInterval #define NSOpenGLContextParameterSurfaceOpacity NSOpenGLCPSurfaceOpacity