Revision 28c4741a libavformat/network.h

View differences:

libavformat/network.h
27 27
#include <winsock2.h>
28 28
#include <ws2tcpip.h>
29 29

  
30
#define ff_neterrno() (-WSAGetLastError())
31
#define FF_NETERROR(err) (-WSA##err)
32
#define WSAEAGAIN WSAEWOULDBLOCK
30
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
31
#define ETIMEDOUT       WSAETIMEDOUT
32
#define ECONNREFUSED    WSAECONNREFUSED
33
#define EINPROGRESS     WSAEINPROGRESS
34

  
35
static inline int ff_neterrno() {
36
    int err = WSAGetLastError();
37
    switch (err) {
38
    case WSAEWOULDBLOCK:
39
        return AVERROR(EAGAIN);
40
    case WSAEINTR:
41
        return AVERROR(EINTR);
42
    }
43
    return -err;
44
}
33 45
#else
34 46
#include <sys/types.h>
35 47
#include <sys/socket.h>
......
37 49
#include <netdb.h>
38 50

  
39 51
#define ff_neterrno() AVERROR(errno)
40
#define FF_NETERROR(err) AVERROR(err)
41 52
#endif
42 53

  
43 54
#if HAVE_ARPA_INET_H

Also available in: Unified diff