network: Don't redefine error codes if they already exist in errno.h
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>
This commit is contained in:
parent
e64bceeac0
commit
4b1b1449d9
2 changed files with 17 additions and 0 deletions
|
@ -164,6 +164,14 @@ int ff_neterrno(void)
|
|||
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);
|
||||
}
|
||||
return -err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue