Merge branch 'update-macos-min' into 'main'

Raise minimum supported macOS version to 10.13 (High Sierra)

Closes #3441

See merge request GNOME/glib!4405
This commit is contained in:
Philip Withnall
2024-11-21 11:13:04 +00:00
6 changed files with 13 additions and 49 deletions

View File

@@ -1093,11 +1093,8 @@ extern GType g_proxy_resolver_portal_get_type (void);
extern GType g_network_monitor_portal_get_type (void);
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
extern GType g_cocoa_notification_backend_get_type (void);
#endif
#ifdef HAVE_COCOA
extern GType g_cocoa_notification_backend_get_type (void);
extern GType g_osx_network_monitor_get_type (void);
#endif
@@ -1352,6 +1349,7 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (g_registry_settings_backend_get_type ());
#endif
#ifdef HAVE_COCOA
g_type_ensure (g_cocoa_notification_backend_get_type ());
g_type_ensure (g_nextstep_settings_backend_get_type ());
g_type_ensure (g_osx_app_info_get_type ());
g_type_ensure (g_osx_network_monitor_get_type ());
@@ -1368,9 +1366,6 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (g_power_profile_monitor_portal_get_type ());
g_type_ensure (g_proxy_resolver_portal_get_type ());
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
g_type_ensure (g_cocoa_notification_backend_get_type ());
#endif
#ifdef G_OS_WIN32
g_type_ensure (g_win32_notification_backend_get_type ());
g_type_ensure (_g_winhttp_vfs_get_type ());

View File

@@ -345,12 +345,7 @@ g_nextstep_settings_backend_get_g_variant (id object,
g_variant_builder_init_static (&builder, type);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
for(key in object)
#else
NSEnumerator *enumerator = [object objectEnumerator];
while((key = [enumerator nextObject]))
#endif
{
GVariant *name;
id value;
@@ -386,12 +381,7 @@ g_nextstep_settings_backend_get_g_variant (id object,
value_type = g_variant_type_element (type);
g_variant_builder_init_static (&builder, type);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
for(value in object)
#else
NSEnumerator *enumerator = [object objectEnumerator];
while((value = [enumerator nextObject]))
#endif
{
GVariant *variant = g_nextstep_settings_backend_get_g_variant (value, value_type);

View File

@@ -314,7 +314,6 @@ get_bundle_for_id (CFStringRef bundle_id)
CFURLRef app_url;
NSBundle *bundle;
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
CFArrayRef urls = LSCopyApplicationURLsForBundleIdentifier (bundle_id, NULL);
if (urls)
{
@@ -326,9 +325,6 @@ get_bundle_for_id (CFStringRef bundle_id)
CFRelease (urls);
}
else
#else
if (LSFindApplicationForInfo (kLSUnknownCreator, bundle_id, NULL, NULL, &app_url) == kLSApplicationNotFoundErr)
#endif
{
#ifdef G_ENABLE_DEBUG /* This can fail often, no reason to alloc strings */
gchar *id_str = create_cstr_from_cfstring (bundle_id);
@@ -744,11 +740,7 @@ g_app_info_get_default_for_type_impl (const char *content_type,
gchar *mime_type;
CFStringRef type;
NSBundle *bundle;
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
CFURLRef bundle_id;
#else
CFStringRef bundle_id;
#endif
mime_type = g_content_type_get_mime_type (content_type);
if (g_str_has_prefix (mime_type, "x-scheme-handler/"))
@@ -763,11 +755,7 @@ g_app_info_get_default_for_type_impl (const char *content_type,
type = create_cfstring_from_cstr (content_type);
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
bundle_id = LSCopyDefaultApplicationURLForContentType (type, kLSRolesAll, NULL);
#else
bundle_id = LSCopyDefaultRoleHandlerForContentType (type, kLSRolesAll);
#endif
CFRelease (type);
if (!bundle_id)
@@ -776,11 +764,7 @@ g_app_info_get_default_for_type_impl (const char *content_type,
return NULL;
}
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
bundle = get_bundle_for_url (bundle_id);
#else
bundle = get_bundle_for_id (bundle_id);
#endif
CFRelease (bundle_id);
if (!bundle)

View File

@@ -396,9 +396,7 @@ if host_system != 'windows'
unix_sources += files('gosxappinfo.m')
framework_dep = dependency('appleframeworks', modules : ['Foundation', 'CoreFoundation', 'AppKit'])
platform_deps += [framework_dep]
if glib_have_os_x_9_or_later
unix_sources += files('gcocoanotificationbackend.m')
endif
unix_sources += files('gcocoanotificationbackend.m')
unix_sources += files('gosxnetworkmonitor.c')
application_headers += files('gosxappinfo.h')
else