Commit b4731197 authored by David Fuhrmann's avatar 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.
parent 087ebf98
notifydir = $(pluginsdir)/notify notifydir = $(pluginsdir)/notify
libosx_notifications_plugin_la_SOURCES = notify/osx_notifications.m 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_LDFLAGS = $(AM_LDFLAGS) -rpath '$(notifydir)' -Wl,-framework,AppKit
libosx_notifications_plugin_la_LIBADD = $(LIBS_osx_notifications) 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_SOURCES = notify/notify.c
libnotify_plugin_la_CFLAGS = $(AM_CFLAGS) $(NOTIFY_CFLAGS) libnotify_plugin_la_CFLAGS = $(AM_CFLAGS) $(NOTIFY_CFLAGS)
......
...@@ -272,6 +272,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -272,6 +272,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
- (void)dealloc - (void)dealloc
{ {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
// Clear the remaining lastNotification in Notification Center, if any // Clear the remaining lastNotification in Notification Center, if any
@autoreleasepool { @autoreleasepool {
...@@ -283,6 +285,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -283,6 +285,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
} }
#endif #endif
#pragma clang diagnostic pop
// Release everything // Release everything
[applicationName release]; [applicationName release];
...@@ -306,12 +309,15 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -306,12 +309,15 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[GrowlApplicationBridge setGrowlDelegate:self]; [GrowlApplicationBridge setGrowlDelegate:self];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
if (hasNativeNotifications) { if (hasNativeNotifications) {
[[NSUserNotificationCenter defaultUserNotificationCenter] [[NSUserNotificationCenter defaultUserNotificationCenter]
setDelegate:(id<NSUserNotificationCenterDelegate>)self]; setDelegate:(id<NSUserNotificationCenterDelegate>)self];
} }
#endif #endif
#pragma clang diagnostic pop
} }
} }
...@@ -375,6 +381,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -375,6 +381,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
clickContext:nil clickContext:nil
identifier:@"VLCNowPlayingNotification"]; identifier:@"VLCNowPlayingNotification"];
} else if (hasNativeNotifications) { } else if (hasNativeNotifications) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
// Make the OS X notification and string // Make the OS X notification and string
NSUserNotification *notification = [NSUserNotification new]; NSUserNotification *notification = [NSUserNotification new];
...@@ -398,6 +406,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -398,6 +406,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification]; [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
[notification release]; [notification release];
#endif #endif
#pragma clang diagnostic pop
} }
// Release stuff // Release stuff
...@@ -425,6 +434,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -425,6 +434,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
isInForeground = NO; isInForeground = NO;
} }
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
- (void)userNotificationCenter:(NSUserNotificationCenter *)center - (void)userNotificationCenter:(NSUserNotificationCenter *)center
didActivateNotification:(NSUserNotification *)notification didActivateNotification:(NSUserNotification *)notification
...@@ -447,4 +458,5 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -447,4 +458,5 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
lastNotification = notification; lastNotification = notification;
} }
#endif #endif
#pragma clang diagnostic pop
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment