wsockcompat.h

Go to the documentation of this file.
00001 /* include/wsockcompat.h
00002  * Windows -> Berkeley Sockets compatibility things.
00003  */
00004 
00005 #if !defined __XML_WSOCKCOMPAT_H__
00006 #define __XML_WSOCKCOMPAT_H__
00007 
00008 #ifdef _WIN32_WCE
00009 #include <winsock.h>
00010 #else
00011 #undef HAVE_ERRNO_H
00012 #include <winsock2.h>
00013 
00014 /* the following is a workaround a problem for 'inline' keyword in said
00015    header when compiled with Borland C++ 6 */
00016 #if defined(__BORLANDC__) && !defined(__cplusplus)
00017 #define inline __inline
00018 #endif
00019 
00020 #include <ws2tcpip.h>
00021 
00022 /* Check if ws2tcpip.h is a recent version which provides getaddrinfo() */
00023 #if defined(GetAddrInfo)
00024 #define HAVE_GETADDRINFO
00025 #endif
00026 #endif
00027 
00028 #ifdef __MINGW32__
00029 /* Include <errno.h> here to ensure that it doesn't get included later
00030  * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */
00031 #include <errno.h>
00032 #undef EWOULDBLOCK
00033 #endif
00034 
00035 #if !defined SOCKLEN_T
00036 #define SOCKLEN_T int
00037 #endif
00038 
00039 #define EWOULDBLOCK             WSAEWOULDBLOCK
00040 #define EINPROGRESS             WSAEINPROGRESS
00041 #define EALREADY                WSAEALREADY
00042 #define ENOTSOCK                WSAENOTSOCK
00043 #define EDESTADDRREQ            WSAEDESTADDRREQ
00044 #define EMSGSIZE                WSAEMSGSIZE
00045 #define EPROTOTYPE              WSAEPROTOTYPE
00046 #define ENOPROTOOPT             WSAENOPROTOOPT
00047 #define EPROTONOSUPPORT         WSAEPROTONOSUPPORT
00048 #define ESOCKTNOSUPPORT         WSAESOCKTNOSUPPORT
00049 #define EOPNOTSUPP              WSAEOPNOTSUPP
00050 #define EPFNOSUPPORT            WSAEPFNOSUPPORT
00051 #define EAFNOSUPPORT            WSAEAFNOSUPPORT
00052 #define EADDRINUSE              WSAEADDRINUSE
00053 #define EADDRNOTAVAIL           WSAEADDRNOTAVAIL
00054 #define ENETDOWN                WSAENETDOWN
00055 #define ENETUNREACH             WSAENETUNREACH
00056 #define ENETRESET               WSAENETRESET
00057 #define ECONNABORTED            WSAECONNABORTED
00058 #define ECONNRESET              WSAECONNRESET
00059 #define ENOBUFS                 WSAENOBUFS
00060 #define EISCONN                 WSAEISCONN
00061 #define ENOTCONN                WSAENOTCONN
00062 #define ESHUTDOWN               WSAESHUTDOWN
00063 #define ETOOMANYREFS            WSAETOOMANYREFS
00064 #define ETIMEDOUT               WSAETIMEDOUT
00065 #define ECONNREFUSED            WSAECONNREFUSED
00066 #define ELOOP                   WSAELOOP
00067 #define EHOSTDOWN               WSAEHOSTDOWN
00068 #define EHOSTUNREACH            WSAEHOSTUNREACH
00069 #define EPROCLIM                WSAEPROCLIM
00070 #define EUSERS                  WSAEUSERS
00071 #define EDQUOT                  WSAEDQUOT
00072 #define ESTALE                  WSAESTALE
00073 #define EREMOTE                 WSAEREMOTE
00074 /* These cause conflicts with the codes from errno.h. Since they are 
00075    not used in the relevant code (nanoftp, nanohttp), we can leave 
00076    them disabled.
00077 #define ENAMETOOLONG            WSAENAMETOOLONG
00078 #define ENOTEMPTY               WSAENOTEMPTY
00079 */
00080 
00081 #endif /* __XML_WSOCKCOMPAT_H__ */
footer
 SourceForge.net Logo