MSVC Portability

Zoltán Sólyom z-ismeretlen at freemail.hu
Wed Apr 3 17:31:16 EDT 2013


On 13/04/03 22:04, Daniel Atallah wrote:
> It surely is caused by the mixing of the different C Runtimes between
> the VS versions - you can't mix handles from different C Runtimes.
>
> I think it's asking for trouble to go down the path that you're
> suggesting.  It shouldn't be all that complicated to compile glib and
> use the real fix.
>
> -D
I think you are right and I might take a break from my program and 
compile gtk/glib because. The program doesn't want to connect and doing 
something else might help.

I just ran into the following in giowin32.c (around line270):
if (connect (channel->reset_send, (struct sockaddr *)&server, sizeof 
(server)) == SOCKET_ERROR)
{
     g_warning (G_STRLOC ": connect to reset_recv socket: %s\n",
           g_win32_error_message (WSAGetLastError ()));
}

Connects to reset_send and logs "connect to reset_recv". I'm just 
guessing that the code is correct or Pidgin wouldn't run on Windows, but 
this is misleading.

I copied some code from Pidgin's win32 source to handle the "input_add" 
and "input_remove" callbacks in the PurpleEventLoopUiOps structure as I 
have no idea what they do. Unfortunately the code doesn't work. The 
input_add callback is called, but whatever it watches does not fire. The 
comment above saying "Analogous to g_io_add_watch_full in glib" doesn't 
help because the glib "documentation" is not very detailed. (I don't 
even know what a file descriptor is supposed to be under Windows.) The 
copied Pidgin source creates Winsock2 sockets and does some glib magic 
with them. I have spent the past 5 hours debugging and trying to fix 
this and it was enough. What are these callbacks supposed to do?




More information about the Devel mailing list