Use netinc.h

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1624 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Mark Olsen 2005-11-29 13:32:15 +00:00
parent b3b3a7a83a
commit aac111c7b0
2 changed files with 5 additions and 85 deletions

View File

@ -22,6 +22,7 @@ struct sockaddr;
#include "quakedef.h"
#ifdef _WIN32
#ifdef _MSC_VER
#define USEIPX
#endif
@ -33,53 +34,9 @@ struct sockaddr;
#include "ws2tcpip.h"
#endif
#ifndef _WIN32 //for mac
#include <sys/time.h>
#endif
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EMSGSIZE WSAEMSGSIZE
#define ECONNRESET WSAECONNRESET
#define ECONNABORTED WSAECONNABORTED
#define ECONNREFUSED WSAECONNREFUSED
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <arpa/inet.h>
#include <errno.h>
#include <unistd.h>
#ifdef sun
#include <sys/filio.h>
#endif
#ifdef NeXT
#include <libc.h>
#endif
#define closesocket close
#define ioctlsocket ioctl
#ifndef INVALID_SOCKET
#define INVALID_SOCKET -1
#endif
#endif
#ifdef _WIN32
#define qerrno WSAGetLastError() //windows errors are retrieved via WSAGetLastError
#else
#define qerrno errno //linux and single threaded oses are happy with errno as a global
#endif
#include "netinc.h"
netadr_t net_local_cl_ipadr;
netadr_t net_local_cl_ip6adr;
@ -1126,6 +1083,7 @@ void NET_Init (void)
if (r)
Sys_Error ("Winsock initialization failed.");
#endif
Con_TPrintf(TL_UDPINITED);
#ifndef SERVERONLY

View File

@ -13,6 +13,8 @@ cvar_t plug_loaddefault = {"plug_loaddefault", "1"};
#include "glquake.h"
#endif
#include "netinc.h"
typedef struct plugin_s {
char *name;
vm_t *vm;
@ -799,46 +801,6 @@ int VARGS Plug_Con_RenameSub(void *offset, unsigned int mask, const long *arg)
}
#ifdef _WIN32
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EMSGSIZE WSAEMSGSIZE
#define ECONNRESET WSAECONNRESET
#define ECONNABORTED WSAECONNABORTED
#define ECONNREFUSED WSAECONNREFUSED
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define qerrno WSAGetLastError()
#ifdef IPPROTO_IPV6
#include <ws2tcpip.h>
#endif
#else
#define qerrno errno
#define MSG_PARTIAL 0
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <arpa/inet.h>
#include <errno.h>
#include <unistd.h>
#ifdef __MORPHOS__
#define closesocket CloseSocket
#define ioctlsocket IoctlSocket
#else
#define closesocket close
#define ioctlsocket ioctl
#endif
#endif
typedef enum{
STREAM_NONE,
STREAM_SOCKET,