Subject: Re: Win32 Compilation fixes (MinGW 4.4.0)

Re: Win32 Compilation fixes (MinGW 4.4.0)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 27 Jul 2009 23:15:18 +0200 (CEST)

On Thu, 9 Jul 2009, Steven Van Ingelgem wrote:

> Hereby attached you will find a patch for several warnings fixed:
> - unused parameter 'sockfd'
> - unused parameter 'nonblock'

If they are unused in the session_nonblock() function, there's a bigger
problem since then you won't get your socket non-blocking!

> - comparison between signed and unsigned integer expressions

I don't approve of those changes. Sockets in windows may be unsigned, but they
are then of type SOCKET and thus the reasonable change is to make sure we
detect the correct type and use that all over internally. I suggest we name it
libssh2_socket_t in a manner like:

#ifndef libssh2_socket_typedef
/* socket typedef */
#ifdef WIN32
typedef SOCKET libssh2_socket_t;
#define LIBSSH2_SOCKET_BAD INVALID_SOCKET
#else
typedef int libssh2_socket_t;
#define LIBSSH2_SOCKET_BAD -1
#endif
#define libssh2_socket_typedef
#endif /* libssh2_socket_typedef */

... and then we should make sure to switch to using that type all over
internally when using sockets (instead of int). But I want to postpone that
until after 1.2.

-- 
  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-07-27