[Bug 24394] Issues making telepathy-glib 0.7.37 work on windows

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Oct 13 14:59:57 CEST 2009


http://bugs.freedesktop.org/show_bug.cgi?id=24394





--- Comment #1 from Simon McVittie <simon.mcvittie at collabora.co.uk>  2009-10-13 05:59:56 PST ---
(From update of attachment 30157)
>diff --git a/telepathy-glib/debug.c b/telepathy-glib/debug.c
>index 51e20ae..edc2c10 100755
>--- a/telepathy-glib/debug.c
>+++ b/telepathy-glib/debug.c
>@@ -71,6 +71,12 @@
> 
> #include "debug-internal.h"
> 
>+#ifdef WIN32
>+#define STDIN_FILENO    0       /* standard input file descriptor */
>+#define STDOUT_FILENO   1       /* standard output file descriptor */
>+#define STDERR_FILENO   2       /* standard error file descriptor */
>+#endif

I think it'd actually be cleaner to use 1 and 2 unconditionally, with a
suitable comment, since these constants are universal - Unix shell scripts
basically all rely on fd 1 and 2 being stdout and stderr, for instance, and
GLib just uses 1 and 2. I've written a patch to do this.

>@@ -457,13 +463,28 @@ tp_debug_timestamped_log_handler (const gchar *log_domain,

I'd rather not have this #ifdef mess; I've done a patch that uses
g_time_val_to_iso8601 instead (this is a small behaviour change - the format
changes, and it's no longer in local time - but it's only debug output).

>diff --git a/telepathy-glib/proxy.h b/telepathy-glib/proxy.h
>index bd6b3a9..8bb3027 100755
>--- a/telepathy-glib/proxy.h
>+++ b/telepathy-glib/proxy.h
>@@ -25,8 +25,18 @@
> #include <dbus/dbus-glib.h>
> #include <glib-object.h>
> 
>+#ifdef WIN32
>+#include <glib/gquark.h>
>+#endif

Why is this needed? <glib-object.h> includes <glib.h>, which includes
<glib/gquark.h>... so why do you need to include this header explicitly?

>+#ifdef WIN32
>+#ifdef interface
>+#undef interface
>+#endif
>+#endif

Ugh. What is interface defined to in Win32-land? :-(

In most of the cases where we mention "interface" as an identifier, this is
easy to work around by renaming the function parameter to "iface".

However, TpProxyClass has a member called "interface", which is part of our
API...

We could work around this like so:

#define _TP_CPP_PASTE_TOKENS(a,b) a ## b
GQuark _TP_CPP_PASTE_TOKENS(i,nterface);

or we could just #undef interface. However, #undef'ing interface seems likely
to break whatever API defines it...

Anyone wanting to access the ->interface member would also have to perform a
similar hack, unless we add a tp_proxy_class_set_interface() accessor (which
might not be a bad idea anyway).

When we break API we should probably rename this to dbus_interface or
interface_name, but we're not doing that yet.

>+#if WIN32
>+#undef interface;
>+#endif

That semicolon isn't syntactically right. I've fixed this file by renaming the
"interface" argument to "iface", instead.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the telepathy-bugs mailing list