From f6d08113a652adede8e2132f20e86a57e1553852 Mon Sep 17 00:00:00 2001 From: volker Date: Mon, 16 Nov 2009 16:10:03 +0000 Subject: dbus_watch_get_unix_fd() only exists in libdbus >= 1.1.1 git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1056 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- plugin_dbus.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/plugin_dbus.c b/plugin_dbus.c index 0b5d700..8d040df 100644 --- a/plugin_dbus.c +++ b/plugin_dbus.c @@ -358,7 +358,12 @@ void plugin_exit_dbus(void) static dbus_bool_t add_watch(DBusWatch * w, void *data) { (void) data; //ignore it - int fd = dbus_watch_get_unix_fd(w); //we assume we are using unix +#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR > 1) || (DBUS_VERSION_MAJOR > 1) + int fd = dbus_watch_get_unix_fd(w); +#else + int fd = dbus_watch_get_fd(w); +#endif + // int fd = dbus_watch_get_unix_fd(w); //we assume we are using unix int flags = dbus_watch_get_flags(w); event_add(watch_handle, w, fd, flags & DBUS_WATCH_READABLE, flags & DBUS_WATCH_WRITABLE, dbus_watch_get_enabled(w)); return TRUE; @@ -367,12 +372,22 @@ static dbus_bool_t add_watch(DBusWatch * w, void *data) static void remove_watch(DBusWatch * w, void *data) { (void) data; //ignore it +#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR > 1) || (DBUS_VERSION_MAJOR > 1) event_del(dbus_watch_get_unix_fd(w)); +#else + event_del(dbus_watch_get_fd(w)); +#endif + // event_del(dbus_watch_get_unix_fd(w)); } static void toggle_watch(DBusWatch * w, void *data) { - int fd = dbus_watch_get_unix_fd(w); //we assume we are using unix +#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR > 1) || (DBUS_VERSION_MAJOR > 1) + int fd = dbus_watch_get_unix_fd(w); +#else + int fd = dbus_watch_get_fd(w); +#endif + // int fd = dbus_watch_get_unix_fd(w); //we assume we are using unix int flags = dbus_watch_get_flags(w); event_modify(fd, flags & DBUS_WATCH_READABLE, flags & DBUS_WATCH_WRITABLE, dbus_watch_get_enabled(w)); } -- cgit v1.2.3