Browse files

Support for libnotify >= 0.7.0

The most recent developer version of libnotify changed the signature for
notify_notification_new(). Make the configure script detect the version
of libnotify and use the according function signature.
  • Loading branch information...
1 parent b248989 commit ba55c03f10a5e3060b649e215a0ecdec19117cb5 @inguin inguin committed Nov 13, 2010
Showing with 10 additions and 0 deletions.
  1. +6 −0 configure.ac
  2. +4 −0 src/notify.c
View
6 configure.ac
@@ -42,6 +42,12 @@ Use --disable-notifications to disable desktop notifications.]) ]
)
AC_SUBST(LIBNOTIFY_CFLAGS)
AC_SUBST(LIBNOTIFY_LIBS)
+ PKG_CHECK_MODULES(LIBNOTIFY_OLD, libnotify < 0.7.0,
+ [ AC_MSG_NOTICE([Using old libnotify API.])
+ AC_DEFINE([HAVE_LIBNOTIFY_OLD], [1],
+ [Define to 1 if libnotify version is below 0.7.0]) ],
+ [ AC_MSG_NOTICE([Using new libnotify API.]) ]
+ )
fi
# Checks for header files.
View
4 src/notify.c
@@ -12,7 +12,11 @@ void nall_notify_init(void)
void nall_notify(run_data_t* s)
{
+#ifdef HAVE_LIBNOTIFY_OLD
NotifyNotification* notification = notify_notification_new(s->name, s->buf, NULL, NULL);
+#else
+ NotifyNotification* notification = notify_notification_new(s->name, s->buf, NULL);
+#endif
if (s->status == 0)
notify_notification_set_urgency(notification, NOTIFY_URGENCY_NORMAL);
else

0 comments on commit ba55c03

Please sign in to comment.