[Bug 24395] Issues making telepathy-gabble 0.8.3 work on windows
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Oct 28 16:18:50 CET 2009
http://bugs.freedesktop.org/show_bug.cgi?id=24395
--- Comment #15 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2009-10-28 08:18:50 PST ---
(From update of attachment 30764)
>diff --git a/win32/structs-for-win32.h b/win32/structs-for-win32.h
>new file mode 100755
>index 0000000..97cd917
>--- /dev/null
>+++ b/win32/structs-for-win32.h
>@@ -0,0 +1,88 @@
>+
>+//structs-for-win32.h
>+
>+#define IFNAMSIZ 16
>+//#define SIZE_INTERFACES 100
>+
>+
>+struct ifmap
>+ {
Sorry, but this is entirely wrong. Either Windows has the ioctl to list
interfaces, in which case it must have some header file somewhere which
describes the struct layout correctly; or it doesn't, in which case you don't
need this struct at all.
When making portability changes, please consider the purpose of the code, what
the author is trying to achieve, whether it even makes sense to attempt it on
your platform, and (if so) what the best way would be to achieve that purpose.
In this case, the place where this struct is used is a function that lists the
IP addresses of all local interfaces. The fact that, on Unix, we use particular
functions for this is not actually relevant at all - what's relevant is that we
want a list of IP addresses! According to a cursory web search, Winsock has a
different ioctl which can be used to achieve this.
For the moment, my branch just "stubs out" this function by returning an empty
list of IP addresses on Windows (Bug #24775). If you want SOCKS5 bytestreams
(one of several possible transports for file transfer) to work on Windows,
please provide an implementation on that bug; if you don't care about SOCKS5
bytestreams, you should just be able to leave it as it is.
This *might* make a little bit of sense to have, unfortunately, since it's the
layout of a DNS header in struct form; some OSs provide it in a header, others
don't. In 0.9 we can fix this by using GLib's resolver code and not trying to
implement it ourselves, which makes much more sense.
>+// Bad hack: can't find these on windows
>+#define EAI_OVERFLOW -1
>+#define EAI_SYSTEM -2
That would be because they're part of the Unix API for getaddrinfo(). The fact
that you can't find these error constants probably means that they're
meaningless on Windows, or that there is a different way to discover the
equivalent error. Again, in 0.9 we'll no longer care, because we can start
using GLib's resolver, and we'll no longer need to deal with getaddrinfo().
Have you made any progress on checking that GLib 2.22 compiles and works on
Windows? As a reminder, Gabble 0.9's netcode will be heavily dependent on GLib
>= 2.22, so if GLib 2.22 doesn't work for you, you'll be stuck with a "dead
end".
--
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