# HG changeset patch # User Daniel Atallah # Date 1210881185 0 # Node ID 2555e069cd8c40965c3b2edc91b2e25e6ce4a36f # Parent f1dfc0d70d19a02b098b9793ecdf3f614c2bd9e0 Add the ability on win32 to choose at runtime whether we use the GIOChannel implementation from glib or the one in libpurple. I'm not sure if anyone else will use this, but I've used it for testing and here it is. diff -r f1dfc0d70d19 -r 2555e069cd8c pidgin/Makefile.mingw --- a/pidgin/Makefile.mingw Thu May 15 15:22:04 2008 +0000 +++ b/pidgin/Makefile.mingw Thu May 15 19:53:05 2008 +0000 @@ -20,8 +20,6 @@ LDFLAGS := $(WINAPP) -#CFLAGS += -DWINPIDGIN_USE_GLIB_IO_CHANNEL=1 - ## ## INCLUDE PATHS ## diff -r f1dfc0d70d19 -r 2555e069cd8c pidgin/gtkeventloop.c --- a/pidgin/gtkeventloop.c Thu May 15 15:22:04 2008 +0000 +++ b/pidgin/gtkeventloop.c Thu May 15 19:53:05 2008 +0000 @@ -87,6 +87,12 @@ PidginIOClosure *closure = g_new0(PidginIOClosure, 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("PIDGIN_GLIB_IO_CHANNEL") != NULL) ? 1 : 0; +#endif closure->function = function; closure->data = data; @@ -97,10 +103,12 @@ cond |= PIDGIN_WRITE_COND; #ifdef _WIN32 - channel = wpurple_g_io_channel_win32_new_socket(fd); -#else + if (use_glib_io_channel == 0) + channel = wpurple_g_io_channel_win32_new_socket(fd); + else +#endif channel = g_io_channel_unix_new(fd); -#endif + closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond, pidgin_io_invoke, closure, pidgin_io_destroy);