Re: error compiling giochannel.h in a Win64 build environment



Rick Jones writes:
 > The compiler is complaining about my calls to 
 > g_io_channel_win32_new_socket - it is saying that there is a possible 
 > loss of data converting from a SOCKET to a gint and refusing to generate 
 > an object file.

Thanks for reporting. This is exactly the kind of stuff one is
expected to come across when porting GLib to Win64.

 > I went looking at giochannel.h and found
 > g_io_channel_win32_new_socket takes a "gint socket" as its input.
 > I confirmed it is still that way in 2.10.2 giochannel.h:

 > GIOChannel *g_io_channel_win32_new_socket (gint socket);

 > Shouldn't that parameter be a SOCKET rather than a gint? _I_ am
 > being a good little Windows programmer :) and declaring all my
 > sockets as SOCKET as I'm supposed to, but the above then causes
 > problems.  I'm guessing that in a 64-bit compile environment a
 > SOCKET is a 64-bit quantity rather than 32.

It can't be a SOCKET because we don't want to have to include
<winsock2.h>. It should be some other integer type that is 32 bits on
Win32 and 64 bits on Win64. Hopefully this can be handled without any
need for #ifdefs.

--tml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]