Index: src/main.c =================================================================== --- src/main.c (revision 1229) +++ src/main.c (working copy) @@ -57,6 +57,10 @@ #include "notify.h" #include "request.h" +#ifdef _WIN32 +#include +#endif + /* Copied verbatim from nullclient, modulo changing whitespace. */ #define PURPLE_GLIB_READ_COND (G_IO_IN | G_IO_HUP | G_IO_ERR) #define PURPLE_GLIB_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL) @@ -98,6 +102,12 @@ PurpleGLibIOClosure *closure = g_new0(PurpleGLibIOClosure, 1); GIOChannel *channel; GIOCondition cond = 0; +#ifdef _WIN32 + static int use_glib_io_channel = -1; + + if (use_glib_io_channel == -1) + use_glib_io_channel = (g_getenv("HAZE_GLIB_IO_CHANNEL") != NULL) ? 1 : 0; +#endif closure->function = function; closure->data = data; @@ -107,6 +117,11 @@ if (condition & PURPLE_INPUT_WRITE) cond |= PURPLE_GLIB_WRITE_COND; +#ifdef _WIN32 + if (use_glib_io_channel == 0) + channel = wpurple_g_io_channel_win32_new_socket(fd); + else +#endif channel = g_io_channel_unix_new(fd); closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond, purple_glib_io_invoke, closure, purple_glib_io_destroy);