diff --git a/src/core/resourcedata_mac.mm b/src/core/resourcedata_mac.mm index 8fe39f0..cb5130e 100644 --- a/src/core/resourcedata_mac.mm +++ b/src/core/resourcedata_mac.mm @@ -58,19 +58,9 @@ SingleFontData fontData; @autoreleasepool { - NSFont* systemFont = nil; - if (@available(macOS 10.15, *)) { - systemFont = [NSFont monospacedSystemFontOfSize:13.0 weight:NSFontWeightRegular]; // Use a default size - } - - - if (!systemFont) { - // Fallback for older macOS versions - systemFont = [NSFont systemFontOfSize:13.0]; - } - - if (!systemFont) - // Double check after fallback + // monospacedSystemFontOfSize:weight: requires macOS 10.15 (our baseline). + NSFont* systemFont = [NSFont monospacedSystemFontOfSize:13.0 weight:NSFontWeightRegular]; + if (!systemFont) throw std::runtime_error("Failed to get system font"); CTFontRef ctFont = (__bridge CTFontRef)systemFont; diff --git a/src/window/cocoa/cocoa_display_window.mm b/src/window/cocoa/cocoa_display_window.mm index b2dd940..8b93dd6 100644 --- a/src/window/cocoa/cocoa_display_window.mm +++ b/src/window/cocoa/cocoa_display_window.mm @@ -56,10 +56,9 @@ typedef VkResult(VKAPI_PTR* PFN_vkCreateMetalSurfaceEXT)( #endif #ifdef HAVE_OPENGL +#define GL_SILENCE_DEPRECATION #import #import - -#define GL_SILENCE_DEPRECATION #endif // Forward declarations @@ -637,6 +636,8 @@ - (void)windowDidResize:(NSNotification *)notification void CocoaDisplayWindowImpl::initOpenGL(ZWidgetView* view) { #ifdef HAVE_OPENGL +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" NSOpenGLPixelFormatAttribute attrs[] = { NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery, NSOpenGLPFADoubleBuffer, NSOpenGLPFAColorSize, 24, NSOpenGLPFAAlphaSize, 8, NSOpenGLPFADepthSize, 24, 0 }; NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs]; openglContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil]; @@ -649,6 +650,7 @@ - (void)windowDidResize:(NSNotification *)notification { renderAPI = RenderAPI::Bitmap; // Fallback if OpenGL not available } +#pragma clang diagnostic pop #else renderAPI = RenderAPI::Bitmap; // Fallback if OpenGL not available #endif