curl-library
Errno constants conflict on VC10
Date: Thu, 29 Apr 2010 18:22:40 +0100
Hi,
Has anyone tried to compile Curl-7.20.1 on VS2010 before? I'm getting loads of macro redefinition errors. It appears that VC10 is now defining several errno constants that weren't previously defined. For example:
errno.h:
#define EWOULDBLOCK 140
Unfortunately this conflicts with setup_once.h from Curl:
#define EWOULDBLOCK WSAEWOULDBLOCK
The problem is that WSAEWOULDBLOCK is defined to be 10035L while EWOULDBLOCK is defined as 140, thus simply removing the macro redundancy is not going to solve the issue. In fact, all WSAE* constants start at 10000. Looking at MSDN, it seems Curl should be using the WSA values since it's calling GetLastError() (btw, is there any reason why GetLastError is being used instead of WSAGetLastError?).
Setup_once.h unfortunately appears to have already naively removed the macro redundancy from some errno constants such as EINVAL/WSAEINVAL (there are a few others, and it's guaranteed their values are incompatible).
Note 1: I wonder if using errno instead of GetLastError() would work with the new errno constants on VC10.
Note 2: I've also encountered this problem with OpenSSL 1.0.0 (makes you wonder whether I'm the only person that has tried compiling Curl and OpenSSL on VC10 since the first Beta has been released).
Regards,
Tanguy
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-29