pidgin: 633a39d1: Add the ability on win32 to choose at ru...

datallah at pidgin.im datallah at pidgin.im
Thu May 15 15:55:44 EDT 2008


-----------------------------------------------------------------
Revision: 633a39d1bb64be48e53d970e6a9c3d754091a51b
Ancestor: 328ae78ce53f7df24ec23e268e458a87b3b42b07
Author: datallah at pidgin.im
Date: 2008-05-15T19:53:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/633a39d1bb64be48e53d970e6a9c3d754091a51b

Modified files:
        pidgin/Makefile.mingw pidgin/gtkeventloop.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- pidgin/Makefile.mingw	1ebbd8f7340dc68421109c46cc196236120867b2
+++ pidgin/Makefile.mingw	cbbe5dadd2264e4d796090d0fb835b48bb0a1978
@@ -20,8 +20,6 @@ LDFLAGS := $(WINAPP)
 
 LDFLAGS := $(WINAPP)
 
-#CFLAGS += -DWINPIDGIN_USE_GLIB_IO_CHANNEL=1
-
 ##
 ## INCLUDE PATHS
 ##
============================================================
--- pidgin/gtkeventloop.c	561224e9acbd24518878503f743b6d7025a99e73
+++ pidgin/gtkeventloop.c	c3eaafb3a71ae705da44fdbfe63c559d97982a18
@@ -87,7 +87,13 @@ static guint pidgin_input_add(gint fd, P
 	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 @@ static guint pidgin_input_add(gint fd, P
 		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);
 


More information about the Commits mailing list