2005-11-29 13:12:45 +00:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
2005-11-30 01:20:53 +00:00
|
|
|
#define EWOULDBLOCK WSAEWOULDBLOCK
|
|
|
|
#define EMSGSIZE WSAEMSGSIZE
|
|
|
|
#define ECONNRESET WSAECONNRESET
|
|
|
|
#define ECONNABORTED WSAECONNABORTED
|
|
|
|
#define ECONNREFUSED WSAECONNREFUSED
|
|
|
|
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
|
|
|
#define EAFNOSUPPORT WSAEAFNOSUPPORT
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define USEIPX
|
|
|
|
#endif
|
|
|
|
#include "winquake.h"
|
|
|
|
#ifdef USEIPX
|
|
|
|
#include "wsipx.h"
|
|
|
|
#endif
|
|
|
|
#ifdef IPPROTO_IPV6
|
|
|
|
#include <ws2tcpip.h>
|
|
|
|
#endif
|
2005-11-29 13:12:45 +00:00
|
|
|
#else
|
2005-11-30 01:20:53 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
2005-12-02 01:14:20 +00:00
|
|
|
#include <netinet/tcp.h>
|
2005-11-30 01:20:53 +00:00
|
|
|
#include <netdb.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/uio.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <errno.h>
|
2005-11-29 13:12:45 +00:00
|
|
|
|
2005-11-30 01:20:53 +00:00
|
|
|
#include <unistd.h>
|
2005-11-29 13:12:45 +00:00
|
|
|
|
2005-11-30 01:20:53 +00:00
|
|
|
#ifdef sun
|
|
|
|
#include <sys/filio.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NeXT
|
|
|
|
#include <libc.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__MORPHOS__) && !defined(ixemul)
|
|
|
|
#define closesocket CloseSocket
|
|
|
|
#define ioctlsocket IoctlSocket
|
|
|
|
#else
|
|
|
|
#define closesocket close
|
|
|
|
#define ioctlsocket ioctl
|
|
|
|
#endif
|
2005-11-29 13:12:45 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
2005-11-30 01:20:53 +00:00
|
|
|
#define qerrno WSAGetLastError()
|
2005-11-29 13:12:45 +00:00
|
|
|
#elif defined(__MORPHOS__) && !defined(ixemul)
|
2005-11-30 01:20:53 +00:00
|
|
|
#define qerrno Errno()
|
2005-11-29 13:12:45 +00:00
|
|
|
#else
|
2005-11-30 01:20:53 +00:00
|
|
|
#define qerrno errno
|
2005-11-29 13:12:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef INVALID_SOCKET
|
2005-11-30 01:20:53 +00:00
|
|
|
#define INVALID_SOCKET -1
|
2005-11-29 13:12:45 +00:00
|
|
|
#endif
|
|
|
|
|
2005-12-31 13:33:10 +00:00
|
|
|
#ifndef INADDR_LOOPBACK
|
|
|
|
#define INADDR_LOOPBACK 0x7f000001
|
|
|
|
#endif
|
|
|
|
|