use dbus_watch_get_unix_fd() only in dbus >= 1.1.1

This commit is contained in:
Augusto Destrero 2011-01-03 16:48:39 +01:00
parent b23f1b2eab
commit 3f1ca07e13

View file

@ -72,7 +72,14 @@ int Watch::descriptor() const
#if HAVE_WIN32
return dbus_watch_get_socket((DBusWatch*)_int);
#else
return dbus_watch_get_unix_fd((DBusWatch*)_int);
// check dbus version and use dbus_watch_get_unix_fd() only in dbus >= 1.1.1
#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || \
(DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MAJOR > 1) || \
(DBUS_VERSION_MAJOR > 1)
return dbus_watch_get_unix_fd((DBusWatch*)_int);
#else
return dbus_watch_get_fd((DBusWatch*)_int);
#endif
#endif
}