[vlc-commits] osx_notification: Enable default macOS min version, fix compilation
David Fuhrmann
git at videolan.org
Sun Jul 2 16:31:17 CEST 2017
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Jul 2 16:13:46 2017 +0200| [b47311972388d1fba2f2ada563a2350af7f80393] | committer: David Fuhrmann
osx_notification: Enable default macOS min version, fix compilation
Remove fixed macosx-min-version, as the min version is already
set globally. Fix compilation by ignoring the partial availability
warning. Code is written in a way that it gets disabled on 10.7,
where Growl is still used.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b47311972388d1fba2f2ada563a2350af7f80393
---
modules/notify/Makefile.am | 3 +--
modules/notify/osx_notifications.m | 12 ++++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/modules/notify/Makefile.am b/modules/notify/Makefile.am
index cbe484d691..60045aab80 100644
--- a/modules/notify/Makefile.am
+++ b/modules/notify/Makefile.am
@@ -1,10 +1,9 @@
notifydir = $(pluginsdir)/notify
libosx_notifications_plugin_la_SOURCES = notify/osx_notifications.m
-libosx_notifications_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_osx_notifications) -mmacosx-version-min=10.8
+libosx_notifications_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_osx_notifications)
libosx_notifications_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(notifydir)' -Wl,-framework,AppKit
libosx_notifications_plugin_la_LIBADD = $(LIBS_osx_notifications)
-libosx_notifications_plugin_la_LIBTOOLFLAGS = --tag=CC
libnotify_plugin_la_SOURCES = notify/notify.c
libnotify_plugin_la_CFLAGS = $(AM_CFLAGS) $(NOTIFY_CFLAGS)
diff --git a/modules/notify/osx_notifications.m b/modules/notify/osx_notifications.m
index 0e43ebab14..5cb4758116 100644
--- a/modules/notify/osx_notifications.m
+++ b/modules/notify/osx_notifications.m
@@ -272,6 +272,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
- (void)dealloc
{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
// Clear the remaining lastNotification in Notification Center, if any
@autoreleasepool {
@@ -283,6 +285,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
#endif
+#pragma clang diagnostic pop
// Release everything
[applicationName release];
@@ -306,12 +309,15 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[GrowlApplicationBridge setGrowlDelegate:self];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
if (hasNativeNotifications) {
[[NSUserNotificationCenter defaultUserNotificationCenter]
setDelegate:(id<NSUserNotificationCenterDelegate>)self];
}
#endif
+#pragma clang diagnostic pop
}
}
@@ -375,6 +381,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
clickContext:nil
identifier:@"VLCNowPlayingNotification"];
} else if (hasNativeNotifications) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
// Make the OS X notification and string
NSUserNotification *notification = [NSUserNotification new];
@@ -398,6 +406,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
[notification release];
#endif
+#pragma clang diagnostic pop
}
// Release stuff
@@ -425,6 +434,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
isInForeground = NO;
}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
- (void)userNotificationCenter:(NSUserNotificationCenter *)center
didActivateNotification:(NSUserNotification *)notification
@@ -447,4 +458,5 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
lastNotification = notification;
}
#endif
+#pragma clang diagnostic pop
@end
More information about the vlc-commits
mailing list