From 5eca1758166f35b507be939437391658b92dd713 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:52:50 +0300 Subject: [PATCH] [macOS] Bump min. version to 10.13, and remove deprecated code. (cherry picked from commit fd3e7e25e8c0bed2e8a2418d2b167720e9a532e9) --- platform/osx/detect.py | 8 ++++---- platform/osx/os_osx.mm | 15 --------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 5a3517ef369..6c4328c63d6 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -83,10 +83,10 @@ def configure(env): env.Append(CCFLAGS=["-arch", "arm64", "-mmacosx-version-min=10.15"]) env.Append(LINKFLAGS=["-arch", "arm64", "-mmacosx-version-min=10.15"]) else: - print("Building for macOS 10.12+, platform x86-64.") - env.Append(ASFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"]) - env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"]) - env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"]) + print("Building for macOS 10.13+, platform x86-64.") + env.Append(ASFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"]) + env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"]) + env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"]) if not "osxcross" in env: # regular native build if env["macports_clang"] != "no": diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index f5ca9e65d3d..4d8dd41ace3 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -510,11 +510,7 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) { trackingArea = nil; imeInputEventInProgress = false; [self updateTrackingAreas]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeFileURL]]; -#else - [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]]; -#endif markedText = [[NSMutableAttributedString alloc] init]; return self; } @@ -660,7 +656,6 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; Vector files; NSPasteboard *pboard = [sender draggingPasteboard]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 NSArray *items = pboard.pasteboardItems; for (NSPasteboardItem *item in items) { NSString *path = [item stringForType:NSPasteboardTypeFileURL]; @@ -671,16 +666,6 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; free(utfs); files.push_back(ret); } -#else - NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType]; - for (NSString *ns in filenames) { - char *utfs = strdup([ns UTF8String]); - String ret; - ret.parse_utf8(utfs); - free(utfs); - files.push_back(ret); - } -#endif if (files.size()) { OS_OSX::singleton->main_loop->drop_files(files, 0);