* i_tcp.c: merge these three ifndef USE_WINSOCK blocks together

* mserv.c: added i_tcp.c's USE_WINSOCK macros so socklen_t isn't redundantly defined if Winsock 2 is used
This commit is contained in:
Monster Iestyn 2020-07-12 22:24:10 +01:00
parent e133d8ec37
commit 0f4487eb68
2 changed files with 14 additions and 7 deletions

View file

@ -50,9 +50,6 @@
#else
#ifndef USE_WINSOCK
#include <arpa/inet.h>
#endif //normal BSD API
#ifndef USE_WINSOCK
#ifdef __APPLE_CC__
#ifndef _BSD_SOCKLEN_T_
#define _BSD_SOCKLEN_T_
@ -60,9 +57,6 @@
#endif //__APPLE_CC__
#include <sys/socket.h>
#include <netinet/in.h>
#endif //normal BSD API
#ifndef USE_WINSOCK
#include <netdb.h>
#include <sys/ioctl.h>
#endif //normal BSD API

View file

@ -22,6 +22,19 @@
#define NONET
#endif
#ifndef NO_IPV6
#define HAVE_IPV6
#endif
#ifdef _WIN32
#define USE_WINSOCK
#if /*defined (_WIN64) ||*/ defined (HAVE_IPV6)
#define USE_WINSOCK2
#else //_WIN64/HAVE_IPV6
#define USE_WINSOCK1
#endif
#endif //WIN32 OS
#ifndef NONET
#ifndef NO_IPV6
#define HAVE_IPV6
@ -196,7 +209,7 @@ typedef unsigned long SOCKET_TYPE;
#define ERRSOCKET (-1)
#endif
#if (defined (WATTCP) && !defined (__libsocket_socklen_t)) || defined (_WIN32)
#if (defined (WATTCP) && !defined (__libsocket_socklen_t)) || defined (USE_WINSOCK1)
typedef int socklen_t;
#endif