Remove old non-compliant win32 defines.

This commit is contained in:
KimLS 2019-06-22 16:00:06 -07:00
parent 5d138891d8
commit 4ae0f2a1d7
103 changed files with 192 additions and 306 deletions

View File

@ -1,33 +1,4 @@
#EQEmu CMake
#Variables used:
#EQEMU_DISABLE_CRT_SECURE_WARNINGS
#EQEMU_FAST_FLOATINGPOINT
#EQEMU_ENABLE_CRASH_LOGGING
#EQEMU_DISABLE_SAFESEH
#EQEMU_BUILD_MSVC_MP
#EQEMU_DEBUG_LEVEL
#EQEMU_LOG_LEVEL_STATUS
#EQEMU_LOG_LEVEL_NORMAL
#EQEMU_LOG_LEVEL_ERROR
#EQEMU_LOG_LEVEL_DEBUG
#EQEMU_LOG_LEVEL_QUEST
#EQEMU_LOG_LEVEL_COMMANDS
#EQEMU_LOG_LEVEL_CRASH
#EQEMU_DEPOP_INVALIDATES_CACHE
#EQEMU_ENABLE_BOTS
#EQEMU_DISABLE_LOGSYS
#EQEMU_COMMANDS_LOGGING
#EQEMU_BUILD_SERVER
#EQEMU_BUILD_LOGIN
#EQEMU_BUILD_TESTS
#EQEMU_BUILD_PERL
#EQEMU_BUILD_LUA
#EQEMU_SANITIZE_LUA_LIBS
#EQEMU_BUILD_CLIENT_FILES
#EQEMU_USE_MAP_MMFS
#EQEMU_MAP_DIR
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
IF(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
ENDIF()
@ -45,56 +16,12 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/dependencies" "${CMAKE_PREFIX_PATH}")
#Add our various windows definitions
IF(MSVC OR MINGW)
ADD_DEFINITIONS(-D_WINDOWS)
IF(CMAKE_CL_64)
ADD_DEFINITIONS(-DWIN64)
ELSE(CMAKE_CL_64)
ADD_DEFINITIONS(-DWIN32)
ENDIF(CMAKE_CL_64)
ENDIF(MSVC OR MINGW)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
IF(MSVC)
IF(CMAKE_CL_64)
SET(ZLIB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib_x64")
SET(MYSQL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/mysql_x64")
SET(LUA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/luaj_x64")
SET(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/openssl_x64")
SET(SODIUM_INCLUDE_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/include")
IF(MSVC_VERSION GREATER 1800)
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/x64/Release/v140/dynamic")
ELSEIF(MSVC_VERSION EQUAL 1800)
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/x64/Release/v120/dynamic")
ELSE()
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/x64/Release/v110/dynamic")
ENDIF()
ELSE(CMAKE_CL_64)
SET(ZLIB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib_x86")
SET(MYSQL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/mysql_x86")
SET(LUA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/luaj_x86")
SET(SODIUM_INCLUDE_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/include")
SET(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/openssl_x86")
IF(MSVC_VERSION GREATER 1800)
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/Win32/Release/v140/dynamic")
ELSEIF(MSVC_VERSION EQUAL 1800)
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/Win32/Release/v120/dynamic")
ELSE()
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/Win32/Release/v110/dynamic")
ENDIF()
ENDIF(CMAKE_CL_64)
#disable CRT warnings on windows cause they're annoying as shit and we use C functions everywhere
OPTION(EQEMU_DISABLE_CRT_SECURE_WARNINGS "Disable Secure CRT Warnings" ON)
IF(EQEMU_DISABLE_CRT_SECURE_WARNINGS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ENDIF(EQEMU_DISABLE_CRT_SECURE_WARNINGS)
#fast FP if you'd like it
OPTION(EQEMU_FAST_FLOATINGPOINT "Use MSVC /fp:fast option" ON)
IF(EQEMU_FAST_FLOATINGPOINT)
ADD_DEFINITIONS(/fp:fast)
ENDIF(EQEMU_FAST_FLOATINGPOINT)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
#crash logging currently only works on windows x86/x64
OPTION(EQEMU_ENABLE_CRASH_LOGGING "Enable crash logging" ON)
@ -107,13 +34,6 @@ IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF(EQEMU_BUILD_MSVC_MP)
#We want to compile /MT not /MD so we change that
FOREACH(flag_var CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
IF(${flag_var} MATCHES "/MD")
STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
ENDIF(${flag_var} MATCHES "/MD")
ENDFOREACH(flag_var)
ADD_DEFINITIONS(-DNOMINMAX)
ELSE(MSVC)
#Normally set by perl but we don't use the perl flags anymore so we set it.
@ -242,21 +162,13 @@ ENDIF(EQEMU_ENABLE_BOTS)
#What to build
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
OPTION(EQEMU_BUILD_LOGIN "Build the login server." OFF)
OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON)
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
#C++11 stuff
IF(NOT MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reserved-user-defined-literal")
ENDIF()
ENDIF(NOT MSVC)
#Various definitions
IF(EQEMU_BUILD_PERL)
ADD_DEFINITIONS(-DEMBPERL)
@ -266,12 +178,6 @@ IF(EQEMU_BUILD_LUA)
ADD_DEFINITIONS(-DLUA_EQEMU)
ENDIF(EQEMU_BUILD_LUA)
#Disabled until reevaluation performed
#OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF)
#IF(EQEMU_USE_MAP_MMFS)
# ADD_DEFINITIONS(-DUSE_MAP_MMFS)
#ENDIF(EQEMU_USE_MAP_MMFS)
SET(EQEMU_MAP_DIR "./Maps" CACHE STRING "The dir that maps, water maps, and paths are located in.")
ADD_DEFINITIONS(-DEQDEBUG=${EQEMU_DEBUG_LEVEL})
@ -292,22 +198,23 @@ ADD_DEFINITIONS(-DGLM_ENABLE_EXPERIMENTAL)
#Find everything we need
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(MySQL REQUIRED)
FIND_PACKAGE(Boost REQUIRED)
FIND_PACKAGE(OpenSSL REQUIRED)
#FIND_PACKAGE(Sodium REQUIRED)
IF(EQEMU_BUILD_PERL)
FIND_PACKAGE(PerlLibs REQUIRED)
INCLUDE_DIRECTORIES(SYSTEM "${PERL_INCLUDE_PATH}")
ENDIF(EQEMU_BUILD_PERL)
SET(SERVER_LIBS common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY} libuv fmt recast_navigation)
SET(SERVER_LIBS common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} libuv fmt recast_navigation)
FIND_PACKAGE(Sodium REQUIRED)
IF(SODIUM_FOUND)
OPTION(EQEMU_ENABLE_SECURITY "Use Encryption For TCP Connections" ON)
IF(EQEMU_ENABLE_SECURITY)
INCLUDE_DIRECTORIES(SYSTEM "${SODIUM_INCLUDE_DIRS}")
ADD_DEFINITIONS(-DENABLE_SECURITY)
SET(SERVER_LIBS ${SERVER_LIBS} ${SODIUM_LIBRARIES})
ENDIF()
ENDIF()
#OPTION(EQEMU_ENABLE_SECURITY "Use Encryption For TCP Connections" ON)
#IF(EQEMU_ENABLE_SECURITY)
# INCLUDE_DIRECTORIES(SYSTEM "${SODIUM_INCLUDE_DIRS}")
# ADD_DEFINITIONS(-DENABLE_SECURITY)
# SET(SERVER_LIBS ${SERVER_LIBS} ${SODIUM_LIBRARIES})
#ENDIF()
IF(WIN32)
SET(SERVER_LIBS ${SERVER_LIBS} "ws2_32" "psapi" "iphlpapi" "userenv")
@ -323,13 +230,8 @@ ENDIF()
IF(EQEMU_BUILD_LUA)
FIND_PACKAGE(EQLua51 REQUIRED)
SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_MULTITHREADED ON)
SET(Boost_USE_STATIC_RUNTIME OFF)
SET(BOOST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/boost")
FIND_PACKAGE(Boost REQUIRED)
INCLUDE_DIRECTORIES(SYSTEM "${LUA_INCLUDE_DIR}" "${Boost_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES(SYSTEM "${LUA_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON)
@ -340,6 +242,8 @@ ENDIF(EQEMU_BUILD_LUA)
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES(SYSTEM "${MySQL_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(SYSTEM "${Boost_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES(SYSTEM "${OPENSSL_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/common/glm")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/cereal")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/libuv/include" )

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
add_subdirectory(import)
add_subdirectory(export)

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(export_sources
main.cpp

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(import_sources
main.cpp

View File

@ -1,5 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(common_sources
base_packet.cpp
classes.cpp

View File

@ -23,7 +23,7 @@
* 2005-08-05 v5 - Removed most Lint (http://www.gimpel.com/) errors... thanks to Okko Willeboordse!
*
**********************************************************************/
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#include <tchar.h>
#include <stdio.h>

View File

@ -9,7 +9,7 @@
* 2013-01-26 - Modified by KimLS(KLS) for EQEmu's purposes
*
**********************************************************************/
#ifdef _WINDOWS
#ifdef _WIN32
// #pragma once is supported starting with _MCS_VER 1000,
// so we need not to check the version (because we only support _MSC_VER >= 1100)!
#pragma once

View File

@ -23,7 +23,7 @@
#include <stdio.h>
#include <string.h>
#ifdef _WINDOWS
#ifdef _WIN32
#include <time.h>
#include <winsock2.h>
#include <windows.h>

View File

@ -18,7 +18,7 @@
#include "condition.h"
#ifdef _WINDOWS
#ifdef _WIN32
Condition::Condition()
{

View File

@ -20,7 +20,7 @@
#include "global_define.h"
#include "mutex.h"
#ifndef WIN32
#ifndef _WIN32
#include <pthread.h>
#endif
@ -30,7 +30,7 @@
class Condition {
private:
#ifdef WIN32
#ifdef _WIN32
enum {
SignalEvent = 0,
BroadcastEvent,

View File

@ -2,7 +2,7 @@
#include "eqemu_logsys.h"
#include "crash.h"
#if defined(_WINDOWS) && defined(CRASH_LOGGING)
#if defined(_WIN32) && defined(CRASH_LOGGING)
#include "StackWalker.h"
class EQEmuStackWalker : public StackWalker

View File

@ -30,7 +30,7 @@
#include <string.h>
// Disgrace: for windows compile
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#define snprintf _snprintf
#define strncasecmp _strnicmp

View File

@ -82,17 +82,7 @@ struct VarCache_Struct {
};
class PTimerList;
#ifdef _WINDOWS
#if _MSC_VER > 1700 // greater than 2012 (2013+)
# define _ISNAN_(a) std::isnan(a)
#else
# include <float.h>
# define _ISNAN_(a) _isnan(a)
#endif
#else
# define _ISNAN_(a) std::isnan(a)
#endif
class Database : public DBcore {
public:

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <iostream>
// Disgrace: for windows compile
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#define snprintf _snprintf
#define strncasecmp _strnicmp

View File

@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <iostream>
// Disgrace: for windows compile
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#define snprintf _snprintf
#define strncasecmp _strnicmp

View File

@ -1,4 +1,4 @@
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#endif
@ -13,7 +13,7 @@
#include <mysqld_error.h>
#include <string.h>
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp

View File

@ -1,7 +1,7 @@
#ifndef DBCORE_H
#define DBCORE_H
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#endif

View File

@ -152,7 +152,7 @@ void EQEmuConfig::parse_config()
TerminateWait = atoi(_root["server"]["launcher"]["timers"].get("reterminate", "10000").asString().c_str());
InitialBootWait = atoi(_root["server"]["launcher"]["timers"].get("initial", "20000").asString().c_str());
ZoneBootInterval = atoi(_root["server"]["launcher"]["timers"].get("interval", "2000").asString().c_str());
#ifdef WIN32
#ifdef _WIN32
ZoneExe = _root["server"]["launcher"].get("exe", "zone.exe").asString();
#else
ZoneExe = _root["server"]["launcher"].get("exe", "./zone").asString();

View File

@ -33,7 +33,7 @@
std::ofstream process_log;
#ifdef _WINDOWS
#ifdef _WIN32
#include <direct.h>
#include <conio.h>
#include <iostream>
@ -331,7 +331,7 @@ uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category)
*/
void EQEmuLogSys::ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string &message)
{
#ifdef _WINDOWS
#ifdef _WIN32
HANDLE console_handle;
console_handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_FONT_INFOEX info = { 0 };
@ -413,7 +413,7 @@ void EQEmuLogSys::SetCurrentTimeStamp(char *time_stamp)
*/
void EQEmuLogSys::MakeDirectory(const std::string &directory_name)
{
#ifdef _WINDOWS
#ifdef _WIN32
struct _stat st;
if (_stat(directory_name.c_str(), &st) == 0) // exists
return;

View File

@ -17,7 +17,7 @@
*/
// WHY IS THIS UP HERE
#if defined(_DEBUG) && defined(WIN32)
#if defined(_DEBUG) && defined(_WIN32)
#ifndef _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
@ -27,7 +27,7 @@
#ifndef EQDEBUG_H
#define EQDEBUG_H
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#endif

View File

@ -23,6 +23,6 @@
#include "eq_packet_structs.h"
#ifndef WIN32
#ifndef _WIN32
#include <netinet/in.h> //for htonl
#endif
#endif

View File

@ -17,7 +17,7 @@
*/
#include "ipc_mutex.h"
#ifdef _WINDOWS
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#undef WIN32_LEAN_AND_MEAN
@ -33,7 +33,7 @@
namespace EQEmu {
struct IPCMutex::Implementation {
#ifdef _WINDOWS
#ifdef _WIN32
HANDLE mut_;
#else
int fd_;
@ -42,7 +42,7 @@ namespace EQEmu {
IPCMutex::IPCMutex(std::string name) : locked_(false) {
imp_ = new Implementation;
#ifdef _WINDOWS
#ifdef _WIN32
auto Config = EQEmuConfig::get();
std::string final_name = Config->SharedMemDir + "EQEmuMutex_";
final_name += name;
@ -82,7 +82,7 @@ namespace EQEmu {
}
IPCMutex::~IPCMutex() {
#ifdef _WINDOWS
#ifdef _WIN32
if(locked_) {
ReleaseMutex(imp_->mut_);
}
@ -103,7 +103,7 @@ namespace EQEmu {
return false;
}
#ifdef _WINDOWS
#ifdef _WIN32
DWORD wait_result = WaitForSingleObject(imp_->mut_, INFINITE);
if(wait_result != WAIT_OBJECT_0) {
return false;
@ -121,7 +121,7 @@ namespace EQEmu {
if(!locked_) {
return false;
}
#ifdef _WINDOWS
#ifdef _WIN32
if(!ReleaseMutex(imp_->mut_)) {
return false;
}

View File

@ -17,7 +17,7 @@
*/
#include "memory_mapped_file.h"
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/types.h>
@ -36,7 +36,7 @@
namespace EQEmu {
struct MemoryMappedFile::Implementation {
#ifdef _WINDOWS
#ifdef _WIN32
HANDLE mapped_object_;
#else
int fd_;
@ -47,7 +47,7 @@ namespace EQEmu {
: filename_(filename), size_(size) {
imp_ = new Implementation;
#ifdef _WINDOWS
#ifdef _WIN32
DWORD total_size = size + sizeof(shared_memory_struct);
HANDLE file = CreateFile(filename.c_str(),
GENERIC_READ | GENERIC_WRITE,
@ -116,7 +116,7 @@ namespace EQEmu {
size_ = size;
fclose(f);
#ifdef _WINDOWS
#ifdef _WIN32
DWORD total_size = size + sizeof(shared_memory_struct);
HANDLE file = CreateFile(filename.c_str(),
GENERIC_READ | GENERIC_WRITE,
@ -172,7 +172,7 @@ namespace EQEmu {
}
MemoryMappedFile::~MemoryMappedFile() {
#ifdef _WINDOWS
#ifdef _WIN32
if(imp_->mapped_object_) {
CloseHandle(imp_->mapped_object_);
}

View File

@ -1,4 +1,4 @@
#ifdef _WINDOWS
#ifdef _WIN32
// VS6 doesn't like the length of STL generated names: disabling
#pragma warning(disable:4786)
#endif
@ -10,7 +10,7 @@
#include <iostream>
#include <zlib.h>
#ifndef WIN32
#ifndef _WIN32
#include <sys/time.h>
#endif
@ -24,7 +24,7 @@
std::map<int,std::string> DBFieldNames;
#ifndef WIN32
#ifndef _WIN32
#if defined(FREEBSD) || defined(__CYGWIN__)
int print_stacktrace()
{
@ -526,7 +526,7 @@ std::string generate_key(int length)
{
std::string key;
//TODO: write this for win32...
#ifndef WIN32
#ifndef _WIN32
int i;
timeval now;
static const char *chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

View File

@ -24,7 +24,7 @@ void decode(char *in, char *out);
void encode_chunk(char *in, int len, char *out);
void decode_chunk(char *in, char *out);
#ifndef WIN32
#ifndef _WIN32
int print_stacktrace();
#endif

View File

@ -22,19 +22,19 @@
#include <string.h>
#include <time.h>
#ifndef WIN32
#ifndef _WIN32
#include <netinet/in.h>
#include <sys/socket.h>
#endif
#include <iostream>
#include <iomanip>
#ifdef _WINDOWS
#ifdef _WIN32
#include <io.h>
#endif
#include "../common/timer.h"
#include "../common/seperator.h"
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#define snprintf _snprintf
@ -73,7 +73,7 @@ void CoutTimestamp(bool ms) {
int32 filesize(FILE* fp) {
#ifdef _WINDOWS
#ifdef _WIN32
return _filelength(_fileno(fp));
#else
struct stat file_stat;
@ -88,7 +88,7 @@ int32 filesize(FILE* fp) {
}
uint32 ResolveIP(const char* hostname, char* errbuf) {
#ifdef _WINDOWS
#ifdef _WIN32
static InitWinsock ws;
#endif
if (errbuf)
@ -99,14 +99,14 @@ uint32 ResolveIP(const char* hostname, char* errbuf) {
return 0;
}
struct sockaddr_in server_sin;
#ifdef _WINDOWS
#ifdef _WIN32
PHOSTENT phostent = nullptr;
#else
struct hostent *phostent = nullptr;
#endif
server_sin.sin_family = AF_INET;
if ((phostent = gethostbyname(hostname)) == nullptr) {
#ifdef _WINDOWS
#ifdef _WIN32
if (errbuf)
snprintf(errbuf, ERRBUF_SIZE, "Unable to get the host name. Error: %i", WSAGetLastError());
#else
@ -115,7 +115,7 @@ uint32 ResolveIP(const char* hostname, char* errbuf) {
#endif
return 0;
}
#ifdef _WINDOWS
#ifdef _WIN32
memcpy ((char FAR *)&(server_sin.sin_addr), phostent->h_addr, phostent->h_length);
#else
memcpy ((char*)&(server_sin.sin_addr), phostent->h_addr, phostent->h_length);
@ -136,7 +136,7 @@ bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf
return false;
}
#ifdef _WINDOWS
#ifdef _WIN32
InitWinsock::InitWinsock() {
WORD version = MAKEWORD (1,1);
WSADATA wsadata;
@ -157,7 +157,7 @@ const char * itoa(int num) {
return temp;
}
#ifndef WIN32
#ifndef _WIN32
const char * itoa(int num, char* a,int b) {
static char temp[_ITOA_BUFLEN];
memset(temp,0,_ITOA_BUFLEN);

View File

@ -77,7 +77,7 @@ uint32 Catch22(uint32 mask);
#define _ITOA_BUFLEN 25
const char *itoa(int num); //not thread safe
#ifndef _WINDOWS
#ifndef _WIN32
const char *itoa(int num, char* a,int b);
#endif

View File

@ -25,7 +25,7 @@
#endif
#ifdef _WINDOWS
#ifdef _WIN32
bool IsTryLockSupported();
bool TrylockSupported = IsTryLockSupported();
@ -69,7 +69,7 @@ Mutex::Mutex() {
#if DEBUG_MUTEX_CLASS >= 7
std::cout << "Constructing Mutex" << std::endl;
#endif
#ifdef _WINDOWS
#ifdef _WIN32
InitializeCriticalSection(&CSMutex);
#else
pthread_mutexattr_t attr;
@ -85,7 +85,7 @@ Mutex::Mutex() {
}
Mutex::~Mutex() {
#ifdef _WINDOWS
#ifdef _WIN32
DeleteCriticalSection(&CSMutex);
#else
#endif
@ -95,14 +95,14 @@ void Mutex::lock() {
#if DEBUG_MUTEX_CLASS >= 5
if (!trylock()) {
std::cout << "Locking Mutex: Having to wait" << std::endl;
#ifdef _WINDOWS
#ifdef _WIN32
EnterCriticalSection(&CSMutex);
#else
pthread_mutex_lock(&CSMutex);
#endif
}
#else
#ifdef _WINDOWS
#ifdef _WIN32
EnterCriticalSection(&CSMutex);
#else
pthread_mutex_lock(&CSMutex);
@ -111,7 +111,7 @@ void Mutex::lock() {
}
bool Mutex::trylock() {
#ifdef _WINDOWS
#ifdef _WIN32
#if(_WIN32_WINNT >= 0x0400)
if (TrylockSupported)
return TryEnterCriticalSection(&CSMutex);
@ -129,7 +129,7 @@ bool Mutex::trylock() {
}
void Mutex::unlock() {
#ifdef _WINDOWS
#ifdef _WIN32
LeaveCriticalSection(&CSMutex);
#else
pthread_mutex_unlock(&CSMutex);

View File

@ -17,7 +17,7 @@
*/
#ifndef MYMUTEX_H
#define MYMUTEX_H
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#else
@ -36,7 +36,7 @@ public:
bool trylock();
protected:
private:
#if defined WIN32 || defined WIN64
#if defined _WIN32
CRITICAL_SECTION CSMutex;
#else
pthread_mutex_t CSMutex;

View File

@ -1,7 +1,7 @@
#ifndef MYSQL_REQUEST_RESULT_H
#define MYSQL_REQUEST_RESULT_H
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#endif

View File

@ -1,7 +1,7 @@
#ifndef MYSQL_REQUEST_ROW_H
#define MYSQL_REQUEST_ROW_H
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#endif

View File

@ -29,7 +29,7 @@
//#endif
#include <string.h>
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp

View File

@ -23,7 +23,7 @@
#include "packet_dump.h"
#include "packet_functions.h"
#ifndef WIN32
#ifndef _WIN32
#include <netinet/in.h>
#endif

View File

@ -22,7 +22,7 @@
#include "global_define.h"
#include "types.h"
#include "proc_launcher.h"
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/types.h>
@ -39,7 +39,7 @@
ProcLauncher ProcLauncher::s_launcher;
#ifdef _WINDOWS
#ifdef _WIN32
const ProcLauncher::ProcRef ProcLauncher::ProcError = 0xFFFFFFFF;
#else
const ProcLauncher::ProcRef ProcLauncher::ProcError = -1;
@ -47,7 +47,7 @@ const ProcLauncher::ProcRef ProcLauncher::ProcError = -1;
ProcLauncher::ProcLauncher()
{
#ifndef WIN32
#ifndef _WIN32
if(signal(SIGCHLD, ProcLauncher::HandleSigChild) == SIG_ERR)
fprintf(stderr, "Unable to register child signal handler. Thats bad.");
m_signalCount = 0;
@ -55,7 +55,7 @@ ProcLauncher::ProcLauncher()
}
void ProcLauncher::Process() {
#ifdef _WINDOWS
#ifdef _WIN32
std::map<ProcRef, Spec *>::iterator cur, end, tmp;
cur = m_running.begin();
end = m_running.end();
@ -112,7 +112,7 @@ void ProcLauncher::ProcessTerminated(std::map<ProcRef, Spec *>::iterator &it) {
if(it->second->handler != nullptr)
it->second->handler->OnTerminate(it->first, it->second);
#ifdef _WINDOWS
#ifdef _WIN32
CloseHandle(it->second->proc_info.hProcess);
#else //!WIN32
#endif //!WIN32
@ -125,7 +125,7 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) {
Spec *it = to_launch;
to_launch = nullptr;
#ifdef _WINDOWS
#ifdef _WIN32
STARTUPINFO siStartInfo;
BOOL bFuncRetn = FALSE;
@ -283,7 +283,7 @@ bool ProcLauncher::Terminate(const ProcRef &proc, bool graceful) {
//we do not remove it from the list until we have been notified
//that they have been terminated.
#ifdef _WINDOWS
#ifdef _WIN32
if(!TerminateProcess(res->second->proc_info.hProcess, 0)) {
return(false);
}
@ -325,7 +325,7 @@ void ProcLauncher::TerminateAll(bool final) {
}
#ifndef WIN32
#ifndef _WIN32
void ProcLauncher::HandleSigChild(int signum) {
if(signum == SIGCHLD) {
ProcLauncher::get()->m_signalCount++;

View File

@ -33,7 +33,7 @@ public:
static ProcLauncher *get() { return(&s_launcher); }
static void ProcessInThisThread();
#ifdef WIN32
#ifdef _WIN32
typedef DWORD ProcRef;
static const ProcRef ProcError;
#else
@ -55,7 +55,7 @@ public:
std::string logFile; //empty = do not redirect output.
protected:
//None of these fields get copied around
#ifdef WIN32
#ifdef _WIN32
PROCESS_INFORMATION proc_info;
#endif
};
@ -83,7 +83,7 @@ protected:
private:
static ProcLauncher s_launcher;
#ifndef WIN32
#ifndef _WIN32
uint32 m_signalCount;
static void HandleSigChild(int signum);
#endif

View File

@ -23,7 +23,7 @@
#include "database.h"
#include "string_util.h"
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
int gettimeofday (timeval *tp, ...);

View File

@ -121,11 +121,8 @@ private:
int m_activeRuleset;
std::string m_activeName;
#ifdef WIN64
uint32 m_RuleIntValues [_IntRuleCount ];
#else
int m_RuleIntValues [_IntRuleCount ];
#endif
int32 m_RuleIntValues [_IntRuleCount ];
float m_RuleRealValues[_RealRuleCount];
uint32 m_RuleBoolValues[_BoolRuleCount];

View File

@ -21,7 +21,7 @@
// Implement preliminary support for *nix variants
// misanthropicfiend
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
char Ver_name[100];

View File

@ -18,7 +18,7 @@
#ifndef SERVERINFO_H
#define SERVERINFO_H
#ifdef _WINDOWS
#ifdef _WIN32
extern char Ver_name[36];
extern DWORD Ver_build, Ver_min, Ver_maj, Ver_pid;
int GetOS();

View File

@ -77,7 +77,7 @@
#include "classes.h"
#include "spdat.h"
#ifndef WIN32
#ifndef _WIN32
#include <stdlib.h>
#include "unix.h"
#endif

View File

@ -17,7 +17,7 @@
#include "string_util.h"
#include <algorithm>
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#define snprintf _snprintf

View File

@ -18,7 +18,7 @@
// Disgrace: for windows compile
#ifndef WIN32
#ifndef _WIN32
#include <sys/time.h>
#else
#include <sys/timeb.h>
@ -64,7 +64,7 @@ Timer::Timer(uint32 start, uint32 timer, bool iUseAcurateTiming = false) {
}
/* Reimplemented for MSVC - Bounce */
#ifdef _WINDOWS
#ifdef _WIN32
int gettimeofday (timeval *tp, ...)
{
timeb tb;

View File

@ -22,7 +22,7 @@
#include <chrono>
// Disgrace: for windows compile
#ifdef _WINDOWS
#ifdef _WIN32
#include "global_define.h"
int gettimeofday (timeval *tp, ...);
#endif

View File

@ -29,7 +29,7 @@ typedef int16_t int16;
typedef int32_t int32;
typedef int64_t int64;
#ifdef _WINDOWS
#ifdef _WIN32
#pragma warning( disable : 4200 )
#endif
@ -42,7 +42,7 @@ typedef unsigned short ushort;
typedef unsigned char uchar;
typedef const char Const_char; //for perl XS
#ifdef _WINDOWS
#ifdef _WIN32
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
#define snprintf _snprintf
#endif
@ -61,7 +61,7 @@ typedef const char Const_char; //for perl XS
#define H32(i) ((uint32) (i >> 32))
#define L16(i) ((uint16) i)
#ifndef WIN32
#ifndef _WIN32
// More WIN32 compatability
typedef unsigned long DWORD;
typedef unsigned char BYTE;
@ -79,14 +79,14 @@ typedef const char Const_char; //for perl XS
#endif
#ifdef _WINDOWS
#ifdef _WIN32
#define DLLFUNC extern "C" __declspec(dllexport)
#else
#define DLLFUNC extern "C"
#endif
// htonll and ntohll already defined on windows
#ifndef WIN32
#ifndef _WIN32
# if defined(__linux__)
# include <endian.h>
# elif defined(__FreeBSD__) || defined(__NetBSD__)

View File

@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _WINDOWS
#ifndef _WIN32
#include "unix.h"
#include <string.h>

View File

@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _WINDOWS
#ifndef _WIN32
#ifndef __UNIX_H__
#define __UNIX_H__
#include <unistd.h>

View File

@ -10,16 +10,16 @@
// this doesn't do shit for C++ but libc++ and GCC 6.1+ use it to define some macros
#include <ciso646>
#ifndef WIN32
#ifndef _WIN32
extern "C" { //the perl headers dont do this for us...
#endif
#include <perl.h>
#include <XSUB.h>
#ifndef WIN32
#ifndef _WIN32
};
#endif
#ifdef WIN32
#ifdef _WIN32
#ifndef snprintf
#define snprintf _snprintf
#endif

View File

@ -40,7 +40,7 @@
#endif
#define COMPILE_DATE __DATE__
#define COMPILE_TIME __TIME__
#ifndef WIN32
#ifndef _WIN32
#define LAST_MODIFIED __TIME__
#else
#define LAST_MODIFIED __TIMESTAMP__

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(eqlaunch_sources
eqlaunch.cpp

View File

@ -70,7 +70,7 @@ int main(int argc, char *argv[]) {
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
return 1;
}
#ifndef WIN32
#ifndef _WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
return 1;

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(hc_sources
eq.cpp

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.10)
project(libuv)
set(libuv_sources

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(lb_sources
src/class.cpp

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(recast_navigation_sources
detour/src/DetourAlloc.cpp

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(eqlogin_sources
client.cpp
@ -27,14 +27,10 @@ SET(eqlogin_headers
world_server.h
)
FIND_PACKAGE(OpenSSL REQUIRED)
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
ADD_EXECUTABLE(loginserver ${eqlogin_sources} ${eqlogin_headers})
INSTALL(TARGETS loginserver RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
TARGET_LINK_LIBRARIES(loginserver ${SERVER_LIBS} ${OPENSSL_LIBRARIES})
TARGET_LINK_LIBRARIES(loginserver ${SERVER_LIBS})
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

View File

@ -167,7 +167,7 @@ int main()
return 1;
}
#ifdef WIN32
#ifdef _WIN32
#ifdef UNICODE
SetConsoleTitle(L"EQEmu Login Server");
#else

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(qserv_sources
database.cpp

View File

@ -33,7 +33,7 @@
#include <vector>
// Disgrace: for windows compile
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#define snprintf _snprintf
#define strncasecmp _strnicmp

View File

@ -106,7 +106,7 @@ int main() {
}
void UpdateWindowTitle(char* iNewTitle) {
#ifdef _WINDOWS
#ifdef _WIN32
char tmp[500];
if (iNewTitle) {
snprintf(tmp, sizeof(tmp), "QueryServ: %s", iNewTitle);

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(shared_memory_sources
base_data.cpp

View File

@ -36,7 +36,7 @@
EQEmuLogSys LogSys;
#ifdef _WINDOWS
#ifdef _WIN32
#include <direct.h>
#else
#include <unistd.h>
@ -45,7 +45,7 @@ EQEmuLogSys LogSys;
inline bool MakeDirectory(const std::string &directory_name)
{
#ifdef _WINDOWS
#ifdef _WIN32
struct _stat st;
if (_stat(directory_name.c_str(), &st) == 0) {
return false;

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
ADD_SUBDIRECTORY(cppunit)

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(cppunit_sources
collectoroutput.cpp

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(ucs_sources
chatchannel.cpp

View File

@ -32,7 +32,7 @@
#include <map>
// Disgrace: for windows compile
#ifdef _WINDOWS
#ifdef _WIN32
#include <windows.h>
#define snprintf _snprintf
#define strncasecmp _strnicmp

View File

@ -167,7 +167,7 @@ int main() {
}
void UpdateWindowTitle(char* iNewTitle) {
#ifdef _WINDOWS
#ifdef _WIN32
char tmp[500];
if (iNewTitle) {
snprintf(tmp, sizeof(tmp), "UCS: %s", iNewTitle);

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(world_sources
adventure.cpp

View File

@ -60,7 +60,7 @@
//#define IPBASED_AUTH_HACK
// Disgrace: for windows compile
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#else

View File

@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/crash.h"
#include "client.h"
#include "worlddb.h"
#ifdef _WINDOWS
#ifdef _WIN32
#include <process.h>
#define snprintf _snprintf
#define strncasecmp _strnicmp
@ -108,7 +108,7 @@ void CatchSignal(int sig_num);
void CheckForServerScript(bool force_download = false);
inline void UpdateWindowTitle(std::string new_title) {
#ifdef _WINDOWS
#ifdef _WIN32
SetConsoleTitle(new_title.c_str());
#endif
}
@ -160,7 +160,7 @@ int main(int argc, char** argv) {
return 1;
}
#ifndef WIN32
#ifndef _WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
return 1;
@ -604,7 +604,7 @@ void CatchSignal(int sig_num) {
}
void UpdateWindowTitle(char* iNewTitle) {
#ifdef _WINDOWS
#ifdef _WIN32
char tmp[500];
if (iNewTitle) {
snprintf(tmp, sizeof(tmp), "World: %s", iNewTitle);

View File

@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef WIN32
#ifndef _WIN32
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(zone_sources
aa.cpp

View File

@ -49,7 +49,7 @@ extern QueryServ* QServ;
extern WorldServer worldserver;
extern FastMath g_Math;
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp

View File

@ -109,7 +109,7 @@ int GetArgs(char * string)
char *buffer = com_list;
memset(temp,0x0,255);
//memset(buffer,0x0,512);
//#ifdef WIN32
//#ifdef _WIN32
//strcpy(buffer,com_list);
//#else
//strncpy(buffer,com_list,sizeof(buffer)-1);

View File

@ -25,7 +25,7 @@ target to center around.
class Zone;
#ifdef _WINDOWS
#ifdef _WIN32
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
#define snprintf _snprintf
#define vsnprintf _vsnprintf

View File

@ -33,7 +33,7 @@
#include "quest_parser_collection.h"
#ifndef WIN32
#ifndef _WIN32
#include <stdlib.h>
#include "../common/unix.h"
#endif

View File

@ -41,7 +41,7 @@
#include <ctime>
#include <thread>
#ifdef _WINDOWS
#ifdef _WIN32
#define strcasecmp _stricmp
#endif

View File

@ -22,7 +22,7 @@
#include <stdio.h>
// for windows compile
#ifndef _WINDOWS
#ifndef _WIN32
#include <stdarg.h>
#include <sys/socket.h>
#include <netinet/in.h>

View File

@ -59,7 +59,7 @@ namespace EQEmu
#include "zone.h"
#include "zonedb.h"
#ifdef _WINDOWS
#ifdef _WIN32
// since windows defines these within windef.h (which windows.h include)
// we are required to undefine these to use min and max from <algorithm>
#undef min

View File

@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <string.h>
#include <zlib.h>
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp

View File

@ -25,7 +25,7 @@
#include <stdio.h>
#include <zlib.h>
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#define snprintf _snprintf

View File

@ -39,7 +39,7 @@
#include <ctime>
#include <thread>
#ifdef _WINDOWS
#ifdef _WIN32
#define strcasecmp _stricmp
#endif
@ -844,7 +844,7 @@ void command_setanim(Client *c, const Seperator *sep)
void command_serverinfo(Client *c, const Seperator *sep)
{
#ifdef _WINDOWS
#ifdef _WIN32
char intbuffer [sizeof(unsigned long)];
c->Message(0, "Operating system information.");
c->Message(0, " %s", Ver_name);
@ -11815,7 +11815,7 @@ void command_hotfix(Client *c, const Seperator *sep) {
c->Message(0, "Creating and applying hotfix");
std::thread t1([c,hotfix_name]() {
#ifdef WIN32
#ifdef _WIN32
if(hotfix_name.length() > 0) {
system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str());
} else {
@ -11856,7 +11856,7 @@ void command_load_shared_memory(Client *c, const Seperator *sep) {
hotfix_name = sep->arg[1];
c->Message(0, "Loading shared memory segment %s", hotfix_name.c_str());
std::thread t1([c,hotfix_name]() {
#ifdef WIN32
#ifdef _WIN32
if(hotfix_name.length() > 0) {
system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str());
} else {

View File

@ -21,7 +21,7 @@ Child of the Mob class.
-Quagmire
*/
#ifdef _WINDOWS
#ifdef _WIN32
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
#define snprintf _snprintf
#define vsnprintf _vsnprintf

View File

@ -22,15 +22,15 @@ Eglin
#include <EXTERN.h>
#define WIN32IO_IS_STDIO
#ifndef WIN32
#ifndef _WIN32
extern "C" { //the perl headers dont do this for us...
#endif
#include <perl.h>
#include <XSUB.h>
#ifndef WIN32
#ifndef _WIN32
};
#endif
#ifdef WIN32
#ifdef _WIN32
#define snprintf _snprintf
#endif

View File

@ -5,12 +5,12 @@
#include <EXTERN.h>
#define WIN32IO_IS_STDIO
#ifndef WIN32
#ifndef _WIN32
extern "C" { //the perl headers dont do this for us...
#endif
#include <perl.h>
#include <XSUB.h>
#ifndef WIN32
#ifndef _WIN32
};
#endif

View File

@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WINDOWS
#ifdef _WIN32
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
#define snprintf _snprintf
#define vsnprintf _vsnprintf

View File

@ -22,7 +22,7 @@
#include <string.h>
#include <iostream>
#ifdef _WINDOWS
#ifdef _WIN32
#include <process.h>
#else
#include <pthread.h>
@ -43,7 +43,7 @@
#include "npc_scale_manager.h"
#include "../common/say_link.h"
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
@ -532,7 +532,7 @@ void EntityList::MobProcess()
entity_list.RemoveNPC(id);
}
else {
#ifdef _WINDOWS
#ifdef _WIN32
struct in_addr in;
in.s_addr = mob->CastToClient()->GetIP();
Log(Logs::General, Logs::Zone_Server, "Dropping client: Process=false, ip=%s port=%u", inet_ntoa(in), mob->CastToClient()->GetPort());
@ -2688,7 +2688,7 @@ char *EntityList::MakeNameUnique(char *name)
}
for (int i=0; i < 300; i++) {
if (!used[i]) {
#ifdef _WINDOWS
#ifdef _WIN32
snprintf(name, 64, "%s%03d", name, i);
#else
//glibc clears destination of snprintf

View File

@ -21,7 +21,7 @@
#include "map.h"
#include "zone.h"
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#endif

View File

@ -33,7 +33,7 @@
#include <iostream>
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#endif

View File

@ -31,7 +31,7 @@
#include <iostream>
#include <stdlib.h>
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#endif

View File

@ -84,7 +84,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#ifdef _WINDOWS
#ifdef _WIN32
#include <conio.h>
#include <process.h>
#else
@ -279,7 +279,7 @@ int main(int argc, char** argv) {
Log(Logs::General, Logs::Error, "Could not set signal handler");
return 1;
}
#ifndef WIN32
#ifndef _WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
Log(Logs::General, Logs::Error, "Could not set signal handler");
return 1;
@ -442,7 +442,7 @@ int main(int argc, char** argv) {
EQStreamIdentifier stream_identifier;
RegisterAllPatches(stream_identifier);
#ifndef WIN32
#ifndef _WIN32
Log(Logs::Detail, Logs::None, "Main thread running with thread id %d", pthread_self());
#endif
@ -602,7 +602,7 @@ int main(int argc, char** argv) {
}
void CatchSignal(int sig_num) {
#ifdef _WINDOWS
#ifdef _WIN32
Log(Logs::General, Logs::Zone_Server, "Recieved signal: %i", sig_num);
#endif
RunLoops = false;
@ -672,7 +672,7 @@ NetConnection::~NetConnection() {
/* Update Window Title with relevant information */
void UpdateWindowTitle(char* iNewTitle) {
#ifdef _WINDOWS
#ifdef _WIN32
char tmp[500];
if (iNewTitle) {
snprintf(tmp, sizeof(tmp), "%i: %s", ZoneConfig::get()->ZonePort, iNewTitle);

View File

@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#else

View File

@ -46,7 +46,7 @@
#include <stdio.h>
#include <string>
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp

View File

@ -29,7 +29,7 @@
#include <list>
#ifdef _WINDOWS
#ifdef _WIN32
#define M_PI 3.141592
#endif

View File

@ -18,13 +18,13 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "../common/global_define.h"
#include "../common/eqemu_logsys.h"
#include <string.h>
#ifdef _WINDOWS
#ifdef _WIN32
#include <process.h>
#else
#include <pthread.h>
#endif
#ifdef _WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp

View File

@ -34,7 +34,7 @@
#include "bot.h"
#endif
#ifndef WIN32
#ifndef _WIN32
#include <stdlib.h>
#include "../common/unix.h"
#endif

View File

@ -33,7 +33,7 @@
#include <math.h>
#ifndef WIN32
#ifndef _WIN32
#include <stdlib.h>
#include "../common/unix.h"
#endif

View File

@ -87,7 +87,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include <math.h>
#include <algorithm>
#ifndef WIN32
#ifndef _WIN32
#include <stdlib.h>
#include "../common/unix.h"
#endif

View File

@ -22,7 +22,7 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net)
#include <string.h>
#ifdef _WINDOWS
#ifdef _WIN32
#define strcasecmp _stricmp
#endif

View File

@ -21,7 +21,7 @@
#include <stdlib.h>
#include <list>
#ifndef WIN32
#ifndef _WIN32
#include <netinet/in.h> //for htonl
#endif

View File

@ -24,7 +24,7 @@
#include <map>
#ifdef _WINDOWS
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <process.h>

Some files were not shown because too many files have changed in this diff Show More