1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-31 09:57:14 +01:00

Use updated win32 identification.

This commit is contained in:
Sandu Liviu Catalin 2020-04-27 10:17:08 +03:00
parent 6accac3bb1
commit 1e82d7b747
7 changed files with 22 additions and 22 deletions

View File

@ -64,7 +64,7 @@ bool CActiveSocket::ConnectTCP(const char *pAddr, uint16 nPort)
if ((m_pHE = GETHOSTBYNAME(pAddr)) == NULL)
{
#ifdef WIN32
#ifdef _WIN32
TranslateSocketError();
#else
if (h_errno == HOST_NOT_FOUND)
@ -144,7 +144,7 @@ bool CActiveSocket::ConnectUDP(const char *pAddr, uint16 nPort)
if ((m_pHE = GETHOSTBYNAME(pAddr)) == NULL)
{
#ifdef WIN32
#ifdef _WIN32
TranslateSocketError();
#else
if (h_errno == HOST_NOT_FOUND)
@ -202,7 +202,7 @@ bool CActiveSocket::ConnectRAW(const char *pAddr, uint16 nPort)
if ((m_pHE = GETHOSTBYNAME(pAddr)) == NULL)
{
#ifdef WIN32
#ifdef _WIN32
TranslateSocketError();
#else
if (h_errno == HOST_NOT_FOUND)

View File

@ -15,6 +15,6 @@ target_compile_definitions(SimpleSocket PRIVATE _WIN32_WINNT=0x0601)
if(UNIX)
target_compile_definitions(SimpleSocket PRIVATE _LINUX=1)
elseif(WIN32)
target_compile_definitions(SimpleSocket PRIVATE WIN32=1 _WIN32=1)
target_compile_definitions(SimpleSocket PRIVATE _WIN32=1)
target_link_libraries(SimpleSocket PUBLIC Ws2_32)
endif()

View File

@ -51,7 +51,7 @@ CPassiveSocket::CPassiveSocket(CSocketType nType) : CSimpleSocket(nType)
bool CPassiveSocket::BindMulticast(const char *pInterface, const char *pGroup, uint16 nPort)
{
bool bRetVal = false;
#ifdef WIN32
#ifdef _WIN32
ULONG inAddr;
#else
in_addr_t inAddr;
@ -130,7 +130,7 @@ bool CPassiveSocket::BindMulticast(const char *pInterface, const char *pGroup, u
bool CPassiveSocket::Listen(const char *pAddr, uint16 nPort, int32 nConnectionBacklog)
{
bool bRetVal = false;
#ifdef WIN32
#ifdef _WIN32
ULONG inAddr;
#else
in_addr_t inAddr;

View File

@ -137,7 +137,7 @@ bool CSimpleSocket::Initialize()
{
errno = CSimpleSocket::SocketSuccess;
#ifdef WIN32
#ifdef _WIN32
//-------------------------------------------------------------------------
// Data structure containing general Windows Sockets Info
//-------------------------------------------------------------------------
@ -831,7 +831,7 @@ bool CSimpleSocket::SetNonblocking(void)
{
int32 nCurFlags;
#if WIN32
#if _WIN32
nCurFlags = 1;
if (ioctlsocket(m_socket, FIONBIO, (ULONG *)&nCurFlags) != 0)
@ -870,7 +870,7 @@ bool CSimpleSocket::SetBlocking(void)
{
int32 nCurFlags;
#if WIN32
#if _WIN32
nCurFlags = 0;
if (ioctlsocket(m_socket, FIONBIO, (ULONG *)&nCurFlags) != 0)
@ -1010,7 +1010,7 @@ void CSimpleSocket::TranslateSocketError(void)
break;
}
#endif
#ifdef WIN32
#ifdef _WIN32
int32 nError = WSAGetLastError();
switch (nError)
{

View File

@ -71,7 +71,7 @@ extern "C"
typedef int SOCKET;
#endif
#ifdef WIN32
#ifdef _WIN32
struct iovec {
void *iov_base;
size_t iov_len;
@ -85,11 +85,11 @@ extern "C"
typedef int int32;
#endif
#ifdef WIN32
#ifdef _WIN32
typedef int socklen_t;
#endif
#if defined(WIN32)
#if defined(_WIN32)
typedef unsigned long long int uint64;
typedef long long int int64;
#elif (__WORDSIZE == 32)
@ -102,7 +102,7 @@ extern "C"
typedef long int int64;
#endif
#ifdef WIN32
#ifdef _WIN32
#ifndef UINT8_MAX
#define UINT8_MAX (UCHAR_MAX)
@ -123,7 +123,7 @@ extern "C"
#endif
#endif
#if defined(WIN32)
#if defined(_WIN32)
#define ssize_t size_t
#endif
@ -150,7 +150,7 @@ extern "C"
/* Socket Macros */
/* */
/*---------------------------------------------------------------------------*/
#ifdef WIN32
#ifdef _WIN32
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
@ -226,19 +226,19 @@ extern "C"
/* Misc Macros */
/* */
/*---------------------------------------------------------------------------*/
#if defined(WIN32)
#if defined(_WIN32)
#define GET_CLOCK_COUNT(x) QueryPerformanceCounter((LARGE_INTEGER *)x)
#else
#define GET_CLOCK_COUNT(x) gettimeofday(x, NULL)
#endif
#if defined(WIN32)
#if defined(_WIN32)
#define STRTOULL(x) _atoi64(x)
#else
#define STRTOULL(x) strtoull(x, NULL, 10)
#endif
#if defined(WIN32)
#if defined(_WIN32)
#define SNPRINTF _snprintf
#define PRINTF printf
#define VPRINTF vprintf

View File

@ -570,7 +570,7 @@ protected:
struct sockaddr_in m_stMulticastGroup; /// multicast group to bind to
struct linger m_stLinger; /// linger flag
CStatTimer m_timer; /// internal statistics.
#ifdef WIN32
#ifdef _WIN32
WSADATA m_hWSAData; /// Windows
#endif
fd_set m_writeFds; /// write file descriptor set

View File

@ -45,7 +45,7 @@
#include <string.h>
#if WIN32
#if _WIN32
#include <Winsock2.h>
#include <time.h>
#endif
@ -57,7 +57,7 @@
#include "Host.h"
#if defined(WIN32)
#if defined(_WIN32)
#define GET_CLOCK_COUNT(x) QueryPerformanceCounter((LARGE_INTEGER *)x)
#else
#define GET_CLOCK_COUNT(x) gettimeofday(x, NULL)