aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvolker <volker@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2009-11-16 16:10:03 +0000
committervolker <volker@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2009-11-16 16:10:03 +0000
commitf6d08113a652adede8e2132f20e86a57e1553852 (patch)
treecb477aeb52f3b007ef6a108aaf94d3f6eba29cec
parent5ef3e9233ff0a8848acefb577ad301bf8bb3f3bf (diff)
downloadlcd4linux-f6d08113a652adede8e2132f20e86a57e1553852.tar.gz
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
-rw-r--r--plugin_dbus.c19
1 files 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));
}