libusb-win32 uses 116 for expressing ETIMEDOUT, but mingw32 doesn't provide it.
Actually, as of w32api 3.9, there are a lot of missing POSIX errno constants, namely
EADDRINUSE
EADDRNOTAVAIL
EAFNOSUPPORT
EAGAIN
EALREADY
EBADMSG
ECANCELED
ECONNABORTED
ECONNREFUSED
ECONNRESET
EDESTADDRREQ
EDQUOT
EHOSTUNREACH
EIDRM
EINPROGRESS
EISCONN
ELOOP
EMSGSIZE
EMULTIHOP
ENETDOWN
ENETRESET
ENETUNREACH
ENOBUFS
ENOLINK
ENOMSG
ENOPROTOOPT
ENOTCONN
ENOTSOCK
ENOTSUP
EOPNOTSUPP
EOVERFLOW
EPROTO
EPROTONOSUPPORT
EPROTOTYPE
ESTALE
ETIMEDOUT
ETXTBSY
EWOULDBLOCK
Logged In: YES
user_id=823908
Originator: NO
It's arguable whether these POSIX errno constants *should* actually be added to any MinGW header. Many of them are unsupported by the MSVCRT runtime, so what value would we give them? Better, perhaps, to have the compiler tell you, when you try to make use of an unsupported feature.
If you can point us to a definitive MSDN source, giving appropriate values for any you think should be included, then we'll add them.
Logged In: YES
user_id=11494
Originator: NO
ETIMEDOUT is a BSD sockets thing. On windows, the socket api is not part of the C runtime but part of the Winsock interface.
What you might try
#include <winsock2.h>
#define ETIMEDOUT WSAETIMEDOUT
and likewise for some of the other socket-related errors you list
Then use WSAGetLastError() rather than errno to retrieve and test socket errors
Danny
Logged In: YES
user_id=902030
Originator: YES
Mmm, maybe ETIMEDOUT comes from BSD, but it's now in posix. As of using WSAETIMEDOUT, it won't work in my case (libusb-win32), since I expect the value to be 116.
Logged In: YES
user_id=823908
Originator: NO
> Mmm, maybe ETIMEDOUT comes from BSD, but it's now in posix.
So what? Woe32 is not POSIX.
> As of using WSAETIMEDOUT, it won't work in my case
> (libusb-win32), since I expect the value to be 116.
Then you need to adapt your application; what you get back from WSAGetLastError() will be WSAETIMEDOUT; that's the best you can hope for.
Sorry, but I think we should close this with `no action required'.