[PATCH]: adapt to new DBusWatch api
Kel Modderman
kel
Mon Nov 5 13:51:23 PST 2007
On Tue, 6 Nov 2007 12:44:20 am Dan Williams wrote:
> On Sun, 2007-11-04 at 18:11 -0800, Jouni Malinen wrote:
> > On Sun, Nov 04, 2007 at 08:26:19AM +1000, Kel Modderman wrote:
> > > Concerning the following compile warnings:
> > > ctrl_iface_dbus.c: In function 'connection_setup_add_watch':
> > > ctrl_iface_dbus.c:86: warning: 'dbus_watch_get_fd' is deprecated
> > > (declared at /usr/include/dbus-1.0/dbus/dbus-connection.h:357)
> > >
> > > The DBusWatch api has tagged dbus_watch_get_fd as deprecated in favour
> > > of dbus_watch_get_unix_fd [0].
> > > [0] http://dbus.freedesktop.org/doc/api/html/group__DBusWatch.html
> >
> > When was this deprecated? The header files I have on my system (dbus
> > 1.0.2) do not have any notes on it being deprecated. The web page is
> > stating that it is deprecated, but that would not show up in compilation
> > results.. Based on NEWS file from dbus-1.1.2, this was done in D-Bus
> > 1.1.1 which is a development release. Is that version (or 1.1.2 for that
> > matter) being deployed in some distros already?
>
> Fedora 8 will have 1.1.2 at least. The patch _looks_ OK, but I'll ask
> around a bit about the expected changes here.
Debian Lenny will have >= 1.1.2.
>
> > > Attached patch directly changes to this api, as I cannot think of sane
> > > way to add compile time test of DBUS_VERSION_* or the like.
> > >
> > > - fd = dbus_watch_get_fd(watch);
> > > + fd = dbus_watch_get_unix_fd(watch);
> >
> > dbus_watch_get_unix_fd() does not seem to be available in dbus 0.90
> > ("API/ABI freeze for 1.0" in change log), 1.0.0, or even 1.0.2. In other
> > words, I don't think it is available in any stable dbus release and as
> > such, this patch would break a lot (most?) of existing systems and I
> > don't think I can apply this change at this point.
> >
> > If there is no DBUS_VERSION_* macro that changes between dbus 1.0.x and
> > 1.1.x (or well, 1.2.x, once the stable release becomes available) and
> > the API is changes, someone better try to get dbus maintainers to fix
> > this.. There really needs to be a compile time mechanism for #ifdef'ing
> > this properly.
>
> I'll look into that too; I've been using some configure.ac magic in
> NetworkManager to detect the version, but it certainly would be better
> to have dbus upstream have the version macros themselves.
Most other projects around that adjusted to this new stuff used
DBUS_VERSION_MAJOR, DBUS_VERSION_MINOR, DBUS_VERSION_MICRO that were
generated by `pkg-config --modversion dbus-1` + script somewhere in the build system.
eg:
#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(watch);
#else
int fd = dbus_watch_get_fd(watch);
#endif
Thanks, Kel.
More information about the Hostap
mailing list