On Tue, 27 Apr 2010, Peter Stuge wrote:
>> + if(-1 == sock) {
>> + fprintf(stderr, "failed to create socket!\n");
>> + return -1;
>> + }
>
> Maybe
>
> #ifdef WIN32
> if (INVALID_SOCKET == sock) {
> #else
> if (-1 == sock) {
> #endif
>
> but it's kinda ugly.
Right, it might be nicer to have a section at the top like:
#ifndef INVALID_SOCKET
#define INVALID_SOCKET -1
#define
and then use this unconditionally:
if (INVALID_SOCKET == sock)
The boring part is that we should probably try to do this uniformly in all
examples, and there are 18 of them! ;-O
-- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-develReceived on 2010-04-27