Since the errno.h values don't match the error codes that winsock
returns, map the winsock error codes to the errno ones, to make
sure explicit checks against AVERROR(x) match.
Signed-off-by: Martin Storsjö <martin@martin.st>
return AVERROR(EAGAIN);
case WSAEINTR:
return AVERROR(EINTR);
return AVERROR(EAGAIN);
case WSAEINTR:
return AVERROR(EINTR);
+ case WSAEPROTONOSUPPORT:
+ return AVERROR(EPROTONOSUPPORT);
+ case WSAETIMEDOUT:
+ return AVERROR(ETIMEDOUT);
+ case WSAECONNREFUSED:
+ return AVERROR(ECONNREFUSED);
+ case WSAEINPROGRESS:
+ return AVERROR(EINPROGRESS);
#include <winsock2.h>
#include <ws2tcpip.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#endif
+#ifndef ETIMEDOUT
#define ETIMEDOUT WSAETIMEDOUT
#define ETIMEDOUT WSAETIMEDOUT
+#endif
+#ifndef ECONNREFUSED
#define ECONNREFUSED WSAECONNREFUSED
#define ECONNREFUSED WSAECONNREFUSED
+#endif
+#ifndef EINPROGRESS
#define EINPROGRESS WSAEINPROGRESS
#define EINPROGRESS WSAEINPROGRESS
#define getsockopt(a, b, c, d, e) getsockopt(a, b, c, (char*) d, e)
#define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*) d, e)
#define getsockopt(a, b, c, d, e) getsockopt(a, b, c, (char*) d, e)
#define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*) d, e)