From 3f56b8091d8e48c9d5bf82c9459dac61c49df9c6 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 2 Feb 2026 12:41:03 +0100 Subject: macOS: remove code present only to support macOS versions 10.6 and earlier. It's possible to build and run FLTK 1.5 with its use of C++11 for macOS 10.7 and SDK 10.7. This commit makes 10.7 the required minimal version of macOS to build and run FLTK 1.5. --- src/Fl_Native_File_Chooser_MAC.mm | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'src/Fl_Native_File_Chooser_MAC.mm') diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm index 8bb74e0fa..b3dd9ae8f 100644 --- a/src/Fl_Native_File_Chooser_MAC.mm +++ b/src/Fl_Native_File_Chooser_MAC.mm @@ -476,10 +476,7 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { return t; } -@interface FLopenDelegate : NSObject -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - -#endif +@interface FLopenDelegate : NSObject { NSPopUpButton *nspopup; char **filter_pattern; @@ -510,10 +507,7 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { } @end -@interface FLsaveDelegate : NSObject -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - -#endif +@interface FLsaveDelegate : NSObject { NSSavePanel *dialog; BOOL saveas_confirm; @@ -551,7 +545,6 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { // runs when the save panel popup menu changes output file type // correspondingly changes the extension of the output file name { - if (fl_mac_os_version < 100600) return; // because of setNameFieldStringValue and nameFieldStringValue char *s = fl_strdup([[(NSPopUpButton*)sender titleOfSelectedItem] UTF8String]); if (!s) return; char *p = strchr(s, '('); @@ -592,11 +585,7 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { @end @implementation FLHiddenFilesAction - (void)action { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - if (fl_mac_os_version >= 100600) { - [panel setShowsHiddenFiles:[button intValue]]; // 10.6 - } -#endif + [panel setShowsHiddenFiles:[button intValue]]; // 10.6 } @end @@ -675,8 +664,8 @@ int Fl_Quartz_Native_File_Chooser_Driver::runmodal() fname = [preset lastPathComponent]; } if (_directory && !dir) dir = [[NSString alloc] initWithUTF8String:_directory]; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 && defined(__BLOCKS__) - if (fl_mac_os_version >= 100600) { +#if defined(__BLOCKS__) + { bool usepath = false; NSString *path = nil; if (dir && fname && [_panel isKindOfClass:[NSOpenPanel class]]) { @@ -707,14 +696,13 @@ int Fl_Quartz_Native_File_Chooser_Driver::runmodal() retval = [_panel runModal]; } } - else -#endif - { // the deprecation warning can be ignored because runs only for macOS < 10.6 +#else // !__BLOCKS__ + // the deprecation warning runs only without blocks #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" retval = [_panel runModalForDirectory:dir file:fname]; // deprecated in 10.6 #pragma clang diagnostic pop - } +#endif // __BLOCKS__ [dir release]; [preset release]; return (retval == NSModalResponseOK ? 1 : 0); -- cgit v1.2.3