diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-06-16 19:48:55 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-06-16 19:48:55 +0200 |
| commit | 377ff11ec9995d2842257daa7edde4e57320512e (patch) | |
| tree | af7634ed8539796abb4160a5ef49fcbe9656d709 /src/Fl_Native_File_Chooser_MAC.mm | |
| parent | d137ddfa7d7feee3fda34b41ea28448377c4bd24 (diff) | |
Link frameworks used by recent macOS versions with -weak_framework
This allows FLTK apps to use the recent frameworks when they run on recent
macOS versions even if the minimum supported macOS version of these apps is more
ancient than the framework.
Diffstat (limited to 'src/Fl_Native_File_Chooser_MAC.mm')
| -rw-r--r-- | src/Fl_Native_File_Chooser_MAC.mm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm index 5d8741460..5c424cb24 100644 --- a/src/Fl_Native_File_Chooser_MAC.mm +++ b/src/Fl_Native_File_Chooser_MAC.mm @@ -532,11 +532,10 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { - (void)control_allowed_types:(const char *)p { NSString *ext = [NSString stringWithUTF8String:p]; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 && \ - MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0 - if (fl_mac_os_version >= 110000) { - UTType *type = [UTType typeWithFilenameExtension:ext]; // 11.0 + framework UniformTypeIdentifiers - [dialog setAllowedContentTypes:[NSArray arrayWithObject:type]]; // 11.0 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 + if (@available(macOS 11.0, *)) { + UTType *type = [UTType typeWithFilenameExtension:ext]; // 11.0 + framework UniformTypeIdentifiers + [dialog setAllowedContentTypes:[NSArray arrayWithObject:type]]; // 11.0 } else #endif |
