mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-07 07:12:25 +00:00
Remove old non-compliant win32 defines.
This commit is contained in:
parent
5d138891d8
commit
4ae0f2a1d7
136
CMakeLists.txt
136
CMakeLists.txt
@ -1,33 +1,4 @@
|
|||||||
#EQEmu CMake
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
#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)
|
|
||||||
IF(POLICY CMP0074)
|
IF(POLICY CMP0074)
|
||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -45,56 +16,12 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
|
|||||||
|
|
||||||
SET(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/dependencies" "${CMAKE_PREFIX_PATH}")
|
SET(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/dependencies" "${CMAKE_PREFIX_PATH}")
|
||||||
|
|
||||||
#Add our various windows definitions
|
SET(CMAKE_CXX_STANDARD 11)
|
||||||
IF(MSVC OR MINGW)
|
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
ADD_DEFINITIONS(-D_WINDOWS)
|
SET(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
IF(CMAKE_CL_64)
|
|
||||||
ADD_DEFINITIONS(-DWIN64)
|
|
||||||
ELSE(CMAKE_CL_64)
|
|
||||||
ADD_DEFINITIONS(-DWIN32)
|
|
||||||
ENDIF(CMAKE_CL_64)
|
|
||||||
ENDIF(MSVC OR MINGW)
|
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
IF(CMAKE_CL_64)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
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)
|
|
||||||
|
|
||||||
#crash logging currently only works on windows x86/x64
|
#crash logging currently only works on windows x86/x64
|
||||||
OPTION(EQEMU_ENABLE_CRASH_LOGGING "Enable crash logging" ON)
|
OPTION(EQEMU_ENABLE_CRASH_LOGGING "Enable crash logging" ON)
|
||||||
@ -107,13 +34,6 @@ IF(MSVC)
|
|||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
ENDIF(EQEMU_BUILD_MSVC_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)
|
ADD_DEFINITIONS(-DNOMINMAX)
|
||||||
ELSE(MSVC)
|
ELSE(MSVC)
|
||||||
#Normally set by perl but we don't use the perl flags anymore so we set it.
|
#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
|
#What to build
|
||||||
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
|
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_HC "Build the headless client." OFF)
|
||||||
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
|
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
|
||||||
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
|
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
|
||||||
OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON)
|
OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON)
|
||||||
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." 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
|
#Various definitions
|
||||||
IF(EQEMU_BUILD_PERL)
|
IF(EQEMU_BUILD_PERL)
|
||||||
ADD_DEFINITIONS(-DEMBPERL)
|
ADD_DEFINITIONS(-DEMBPERL)
|
||||||
@ -266,12 +178,6 @@ IF(EQEMU_BUILD_LUA)
|
|||||||
ADD_DEFINITIONS(-DLUA_EQEMU)
|
ADD_DEFINITIONS(-DLUA_EQEMU)
|
||||||
ENDIF(EQEMU_BUILD_LUA)
|
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.")
|
SET(EQEMU_MAP_DIR "./Maps" CACHE STRING "The dir that maps, water maps, and paths are located in.")
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DEQDEBUG=${EQEMU_DEBUG_LEVEL})
|
ADD_DEFINITIONS(-DEQDEBUG=${EQEMU_DEBUG_LEVEL})
|
||||||
@ -292,22 +198,23 @@ ADD_DEFINITIONS(-DGLM_ENABLE_EXPERIMENTAL)
|
|||||||
#Find everything we need
|
#Find everything we need
|
||||||
FIND_PACKAGE(ZLIB REQUIRED)
|
FIND_PACKAGE(ZLIB REQUIRED)
|
||||||
FIND_PACKAGE(MySQL REQUIRED)
|
FIND_PACKAGE(MySQL REQUIRED)
|
||||||
|
FIND_PACKAGE(Boost REQUIRED)
|
||||||
|
FIND_PACKAGE(OpenSSL REQUIRED)
|
||||||
|
#FIND_PACKAGE(Sodium REQUIRED)
|
||||||
|
|
||||||
IF(EQEMU_BUILD_PERL)
|
IF(EQEMU_BUILD_PERL)
|
||||||
FIND_PACKAGE(PerlLibs REQUIRED)
|
FIND_PACKAGE(PerlLibs REQUIRED)
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${PERL_INCLUDE_PATH}")
|
INCLUDE_DIRECTORIES(SYSTEM "${PERL_INCLUDE_PATH}")
|
||||||
ENDIF(EQEMU_BUILD_PERL)
|
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)
|
#OPTION(EQEMU_ENABLE_SECURITY "Use Encryption For TCP Connections" ON)
|
||||||
IF(SODIUM_FOUND)
|
#IF(EQEMU_ENABLE_SECURITY)
|
||||||
OPTION(EQEMU_ENABLE_SECURITY "Use Encryption For TCP Connections" ON)
|
# INCLUDE_DIRECTORIES(SYSTEM "${SODIUM_INCLUDE_DIRS}")
|
||||||
IF(EQEMU_ENABLE_SECURITY)
|
# ADD_DEFINITIONS(-DENABLE_SECURITY)
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${SODIUM_INCLUDE_DIRS}")
|
# SET(SERVER_LIBS ${SERVER_LIBS} ${SODIUM_LIBRARIES})
|
||||||
ADD_DEFINITIONS(-DENABLE_SECURITY)
|
#ENDIF()
|
||||||
SET(SERVER_LIBS ${SERVER_LIBS} ${SODIUM_LIBRARIES})
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(SERVER_LIBS ${SERVER_LIBS} "ws2_32" "psapi" "iphlpapi" "userenv")
|
SET(SERVER_LIBS ${SERVER_LIBS} "ws2_32" "psapi" "iphlpapi" "userenv")
|
||||||
@ -323,13 +230,8 @@ ENDIF()
|
|||||||
|
|
||||||
IF(EQEMU_BUILD_LUA)
|
IF(EQEMU_BUILD_LUA)
|
||||||
FIND_PACKAGE(EQLua51 REQUIRED)
|
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}")
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${LUA_INCLUDE_DIR}" "${Boost_INCLUDE_DIRS}")
|
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
|
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)
|
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 "${ZLIB_INCLUDE_DIRS}")
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${MySQL_INCLUDE_DIR}")
|
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}/common/glm")
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/cereal")
|
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/cereal")
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/libuv/include" )
|
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/libuv/include" )
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
add_subdirectory(import)
|
add_subdirectory(import)
|
||||||
add_subdirectory(export)
|
add_subdirectory(export)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(export_sources
|
SET(export_sources
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(import_sources
|
SET(import_sources
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(common_sources
|
SET(common_sources
|
||||||
base_packet.cpp
|
base_packet.cpp
|
||||||
classes.cpp
|
classes.cpp
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
* 2005-08-05 v5 - Removed most Lint (http://www.gimpel.com/) errors... thanks to Okko Willeboordse!
|
* 2005-08-05 v5 - Removed most Lint (http://www.gimpel.com/) errors... thanks to Okko Willeboordse!
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
* 2013-01-26 - Modified by KimLS(KLS) for EQEmu's purposes
|
* 2013-01-26 - Modified by KimLS(KLS) for EQEmu's purposes
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
// #pragma once is supported starting with _MCS_VER 1000,
|
// #pragma once is supported starting with _MCS_VER 1000,
|
||||||
// so we need not to check the version (because we only support _MSC_VER >= 1100)!
|
// so we need not to check the version (because we only support _MSC_VER >= 1100)!
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include "condition.h"
|
#include "condition.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
|
|
||||||
Condition::Condition()
|
Condition::Condition()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "global_define.h"
|
#include "global_define.h"
|
||||||
#include "mutex.h"
|
#include "mutex.h"
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
class Condition {
|
class Condition {
|
||||||
private:
|
private:
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
enum {
|
enum {
|
||||||
SignalEvent = 0,
|
SignalEvent = 0,
|
||||||
BroadcastEvent,
|
BroadcastEvent,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#include "eqemu_logsys.h"
|
#include "eqemu_logsys.h"
|
||||||
#include "crash.h"
|
#include "crash.h"
|
||||||
|
|
||||||
#if defined(_WINDOWS) && defined(CRASH_LOGGING)
|
#if defined(_WIN32) && defined(CRASH_LOGGING)
|
||||||
#include "StackWalker.h"
|
#include "StackWalker.h"
|
||||||
|
|
||||||
class EQEmuStackWalker : public StackWalker
|
class EQEmuStackWalker : public StackWalker
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
|
|||||||
@ -82,17 +82,7 @@ struct VarCache_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class PTimerList;
|
class PTimerList;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
|
||||||
#if _MSC_VER > 1700 // greater than 2012 (2013+)
|
|
||||||
# define _ISNAN_(a) std::isnan(a)
|
# 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 {
|
class Database : public DBcore {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
|
|||||||
@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
#include <mysqld_error.h>
|
#include <mysqld_error.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef DBCORE_H
|
#ifndef DBCORE_H
|
||||||
#define DBCORE_H
|
#define DBCORE_H
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -152,7 +152,7 @@ void EQEmuConfig::parse_config()
|
|||||||
TerminateWait = atoi(_root["server"]["launcher"]["timers"].get("reterminate", "10000").asString().c_str());
|
TerminateWait = atoi(_root["server"]["launcher"]["timers"].get("reterminate", "10000").asString().c_str());
|
||||||
InitialBootWait = atoi(_root["server"]["launcher"]["timers"].get("initial", "20000").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());
|
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();
|
ZoneExe = _root["server"]["launcher"].get("exe", "zone.exe").asString();
|
||||||
#else
|
#else
|
||||||
ZoneExe = _root["server"]["launcher"].get("exe", "./zone").asString();
|
ZoneExe = _root["server"]["launcher"].get("exe", "./zone").asString();
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
std::ofstream process_log;
|
std::ofstream process_log;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#include <iostream>
|
#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)
|
void EQEmuLogSys::ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string &message)
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
HANDLE console_handle;
|
HANDLE console_handle;
|
||||||
console_handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
console_handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
CONSOLE_FONT_INFOEX info = { 0 };
|
CONSOLE_FONT_INFOEX info = { 0 };
|
||||||
@ -413,7 +413,7 @@ void EQEmuLogSys::SetCurrentTimeStamp(char *time_stamp)
|
|||||||
*/
|
*/
|
||||||
void EQEmuLogSys::MakeDirectory(const std::string &directory_name)
|
void EQEmuLogSys::MakeDirectory(const std::string &directory_name)
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
struct _stat st;
|
struct _stat st;
|
||||||
if (_stat(directory_name.c_str(), &st) == 0) // exists
|
if (_stat(directory_name.c_str(), &st) == 0) // exists
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// WHY IS THIS UP HERE
|
// WHY IS THIS UP HERE
|
||||||
#if defined(_DEBUG) && defined(WIN32)
|
#if defined(_DEBUG) && defined(_WIN32)
|
||||||
#ifndef _CRTDBG_MAP_ALLOC
|
#ifndef _CRTDBG_MAP_ALLOC
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <crtdbg.h>
|
#include <crtdbg.h>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
#ifndef EQDEBUG_H
|
#ifndef EQDEBUG_H
|
||||||
#define EQDEBUG_H
|
#define EQDEBUG_H
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -23,6 +23,6 @@
|
|||||||
#include "eq_packet_structs.h"
|
#include "eq_packet_structs.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <netinet/in.h> //for htonl
|
#include <netinet/in.h> //for htonl
|
||||||
#endif
|
#endif
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ipc_mutex.h"
|
#include "ipc_mutex.h"
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
namespace EQEmu {
|
namespace EQEmu {
|
||||||
struct IPCMutex::Implementation {
|
struct IPCMutex::Implementation {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
HANDLE mut_;
|
HANDLE mut_;
|
||||||
#else
|
#else
|
||||||
int fd_;
|
int fd_;
|
||||||
@ -42,7 +42,7 @@ namespace EQEmu {
|
|||||||
|
|
||||||
IPCMutex::IPCMutex(std::string name) : locked_(false) {
|
IPCMutex::IPCMutex(std::string name) : locked_(false) {
|
||||||
imp_ = new Implementation;
|
imp_ = new Implementation;
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
std::string final_name = Config->SharedMemDir + "EQEmuMutex_";
|
std::string final_name = Config->SharedMemDir + "EQEmuMutex_";
|
||||||
final_name += name;
|
final_name += name;
|
||||||
@ -82,7 +82,7 @@ namespace EQEmu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IPCMutex::~IPCMutex() {
|
IPCMutex::~IPCMutex() {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
if(locked_) {
|
if(locked_) {
|
||||||
ReleaseMutex(imp_->mut_);
|
ReleaseMutex(imp_->mut_);
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ namespace EQEmu {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
DWORD wait_result = WaitForSingleObject(imp_->mut_, INFINITE);
|
DWORD wait_result = WaitForSingleObject(imp_->mut_, INFINITE);
|
||||||
if(wait_result != WAIT_OBJECT_0) {
|
if(wait_result != WAIT_OBJECT_0) {
|
||||||
return false;
|
return false;
|
||||||
@ -121,7 +121,7 @@ namespace EQEmu {
|
|||||||
if(!locked_) {
|
if(!locked_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
if(!ReleaseMutex(imp_->mut_)) {
|
if(!ReleaseMutex(imp_->mut_)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "memory_mapped_file.h"
|
#include "memory_mapped_file.h"
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
namespace EQEmu {
|
namespace EQEmu {
|
||||||
|
|
||||||
struct MemoryMappedFile::Implementation {
|
struct MemoryMappedFile::Implementation {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
HANDLE mapped_object_;
|
HANDLE mapped_object_;
|
||||||
#else
|
#else
|
||||||
int fd_;
|
int fd_;
|
||||||
@ -47,7 +47,7 @@ namespace EQEmu {
|
|||||||
: filename_(filename), size_(size) {
|
: filename_(filename), size_(size) {
|
||||||
imp_ = new Implementation;
|
imp_ = new Implementation;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
DWORD total_size = size + sizeof(shared_memory_struct);
|
DWORD total_size = size + sizeof(shared_memory_struct);
|
||||||
HANDLE file = CreateFile(filename.c_str(),
|
HANDLE file = CreateFile(filename.c_str(),
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
@ -116,7 +116,7 @@ namespace EQEmu {
|
|||||||
size_ = size;
|
size_ = size;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
DWORD total_size = size + sizeof(shared_memory_struct);
|
DWORD total_size = size + sizeof(shared_memory_struct);
|
||||||
HANDLE file = CreateFile(filename.c_str(),
|
HANDLE file = CreateFile(filename.c_str(),
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
@ -172,7 +172,7 @@ namespace EQEmu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MemoryMappedFile::~MemoryMappedFile() {
|
MemoryMappedFile::~MemoryMappedFile() {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
if(imp_->mapped_object_) {
|
if(imp_->mapped_object_) {
|
||||||
CloseHandle(imp_->mapped_object_);
|
CloseHandle(imp_->mapped_object_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
// VS6 doesn't like the length of STL generated names: disabling
|
// VS6 doesn't like the length of STL generated names: disabling
|
||||||
#pragma warning(disable:4786)
|
#pragma warning(disable:4786)
|
||||||
#endif
|
#endif
|
||||||
@ -10,7 +10,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
std::map<int,std::string> DBFieldNames;
|
std::map<int,std::string> DBFieldNames;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#if defined(FREEBSD) || defined(__CYGWIN__)
|
#if defined(FREEBSD) || defined(__CYGWIN__)
|
||||||
int print_stacktrace()
|
int print_stacktrace()
|
||||||
{
|
{
|
||||||
@ -526,7 +526,7 @@ std::string generate_key(int length)
|
|||||||
{
|
{
|
||||||
std::string key;
|
std::string key;
|
||||||
//TODO: write this for win32...
|
//TODO: write this for win32...
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
int i;
|
int i;
|
||||||
timeval now;
|
timeval now;
|
||||||
static const char *chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
static const char *chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
|
|||||||
@ -24,7 +24,7 @@ void decode(char *in, char *out);
|
|||||||
void encode_chunk(char *in, int len, char *out);
|
void encode_chunk(char *in, int len, char *out);
|
||||||
void decode_chunk(char *in, char *out);
|
void decode_chunk(char *in, char *out);
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
int print_stacktrace();
|
int print_stacktrace();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -22,19 +22,19 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
#include "../common/timer.h"
|
#include "../common/timer.h"
|
||||||
#include "../common/seperator.h"
|
#include "../common/seperator.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
@ -73,7 +73,7 @@ void CoutTimestamp(bool ms) {
|
|||||||
|
|
||||||
|
|
||||||
int32 filesize(FILE* fp) {
|
int32 filesize(FILE* fp) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
return _filelength(_fileno(fp));
|
return _filelength(_fileno(fp));
|
||||||
#else
|
#else
|
||||||
struct stat file_stat;
|
struct stat file_stat;
|
||||||
@ -88,7 +88,7 @@ int32 filesize(FILE* fp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 ResolveIP(const char* hostname, char* errbuf) {
|
uint32 ResolveIP(const char* hostname, char* errbuf) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
static InitWinsock ws;
|
static InitWinsock ws;
|
||||||
#endif
|
#endif
|
||||||
if (errbuf)
|
if (errbuf)
|
||||||
@ -99,14 +99,14 @@ uint32 ResolveIP(const char* hostname, char* errbuf) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
struct sockaddr_in server_sin;
|
struct sockaddr_in server_sin;
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
PHOSTENT phostent = nullptr;
|
PHOSTENT phostent = nullptr;
|
||||||
#else
|
#else
|
||||||
struct hostent *phostent = nullptr;
|
struct hostent *phostent = nullptr;
|
||||||
#endif
|
#endif
|
||||||
server_sin.sin_family = AF_INET;
|
server_sin.sin_family = AF_INET;
|
||||||
if ((phostent = gethostbyname(hostname)) == nullptr) {
|
if ((phostent = gethostbyname(hostname)) == nullptr) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
if (errbuf)
|
if (errbuf)
|
||||||
snprintf(errbuf, ERRBUF_SIZE, "Unable to get the host name. Error: %i", WSAGetLastError());
|
snprintf(errbuf, ERRBUF_SIZE, "Unable to get the host name. Error: %i", WSAGetLastError());
|
||||||
#else
|
#else
|
||||||
@ -115,7 +115,7 @@ uint32 ResolveIP(const char* hostname, char* errbuf) {
|
|||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
memcpy ((char FAR *)&(server_sin.sin_addr), phostent->h_addr, phostent->h_length);
|
memcpy ((char FAR *)&(server_sin.sin_addr), phostent->h_addr, phostent->h_length);
|
||||||
#else
|
#else
|
||||||
memcpy ((char*)&(server_sin.sin_addr), phostent->h_addr, phostent->h_length);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
InitWinsock::InitWinsock() {
|
InitWinsock::InitWinsock() {
|
||||||
WORD version = MAKEWORD (1,1);
|
WORD version = MAKEWORD (1,1);
|
||||||
WSADATA wsadata;
|
WSADATA wsadata;
|
||||||
@ -157,7 +157,7 @@ const char * itoa(int num) {
|
|||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
const char * itoa(int num, char* a,int b) {
|
const char * itoa(int num, char* a,int b) {
|
||||||
static char temp[_ITOA_BUFLEN];
|
static char temp[_ITOA_BUFLEN];
|
||||||
memset(temp,0,_ITOA_BUFLEN);
|
memset(temp,0,_ITOA_BUFLEN);
|
||||||
|
|||||||
@ -77,7 +77,7 @@ uint32 Catch22(uint32 mask);
|
|||||||
|
|
||||||
#define _ITOA_BUFLEN 25
|
#define _ITOA_BUFLEN 25
|
||||||
const char *itoa(int num); //not thread safe
|
const char *itoa(int num); //not thread safe
|
||||||
#ifndef _WINDOWS
|
#ifndef _WIN32
|
||||||
const char *itoa(int num, char* a,int b);
|
const char *itoa(int num, char* a,int b);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
bool IsTryLockSupported();
|
bool IsTryLockSupported();
|
||||||
bool TrylockSupported = IsTryLockSupported();
|
bool TrylockSupported = IsTryLockSupported();
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ Mutex::Mutex() {
|
|||||||
#if DEBUG_MUTEX_CLASS >= 7
|
#if DEBUG_MUTEX_CLASS >= 7
|
||||||
std::cout << "Constructing Mutex" << std::endl;
|
std::cout << "Constructing Mutex" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
InitializeCriticalSection(&CSMutex);
|
InitializeCriticalSection(&CSMutex);
|
||||||
#else
|
#else
|
||||||
pthread_mutexattr_t attr;
|
pthread_mutexattr_t attr;
|
||||||
@ -85,7 +85,7 @@ Mutex::Mutex() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Mutex::~Mutex() {
|
Mutex::~Mutex() {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
DeleteCriticalSection(&CSMutex);
|
DeleteCriticalSection(&CSMutex);
|
||||||
#else
|
#else
|
||||||
#endif
|
#endif
|
||||||
@ -95,14 +95,14 @@ void Mutex::lock() {
|
|||||||
#if DEBUG_MUTEX_CLASS >= 5
|
#if DEBUG_MUTEX_CLASS >= 5
|
||||||
if (!trylock()) {
|
if (!trylock()) {
|
||||||
std::cout << "Locking Mutex: Having to wait" << std::endl;
|
std::cout << "Locking Mutex: Having to wait" << std::endl;
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
EnterCriticalSection(&CSMutex);
|
EnterCriticalSection(&CSMutex);
|
||||||
#else
|
#else
|
||||||
pthread_mutex_lock(&CSMutex);
|
pthread_mutex_lock(&CSMutex);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
EnterCriticalSection(&CSMutex);
|
EnterCriticalSection(&CSMutex);
|
||||||
#else
|
#else
|
||||||
pthread_mutex_lock(&CSMutex);
|
pthread_mutex_lock(&CSMutex);
|
||||||
@ -111,7 +111,7 @@ void Mutex::lock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Mutex::trylock() {
|
bool Mutex::trylock() {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#if(_WIN32_WINNT >= 0x0400)
|
#if(_WIN32_WINNT >= 0x0400)
|
||||||
if (TrylockSupported)
|
if (TrylockSupported)
|
||||||
return TryEnterCriticalSection(&CSMutex);
|
return TryEnterCriticalSection(&CSMutex);
|
||||||
@ -129,7 +129,7 @@ bool Mutex::trylock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mutex::unlock() {
|
void Mutex::unlock() {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
LeaveCriticalSection(&CSMutex);
|
LeaveCriticalSection(&CSMutex);
|
||||||
#else
|
#else
|
||||||
pthread_mutex_unlock(&CSMutex);
|
pthread_mutex_unlock(&CSMutex);
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef MYMUTEX_H
|
#ifndef MYMUTEX_H
|
||||||
#define MYMUTEX_H
|
#define MYMUTEX_H
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
@ -36,7 +36,7 @@ public:
|
|||||||
bool trylock();
|
bool trylock();
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
#if defined WIN32 || defined WIN64
|
#if defined _WIN32
|
||||||
CRITICAL_SECTION CSMutex;
|
CRITICAL_SECTION CSMutex;
|
||||||
#else
|
#else
|
||||||
pthread_mutex_t CSMutex;
|
pthread_mutex_t CSMutex;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef MYSQL_REQUEST_RESULT_H
|
#ifndef MYSQL_REQUEST_RESULT_H
|
||||||
#define MYSQL_REQUEST_RESULT_H
|
#define MYSQL_REQUEST_RESULT_H
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef MYSQL_REQUEST_ROW_H
|
#ifndef MYSQL_REQUEST_ROW_H
|
||||||
#define MYSQL_REQUEST_ROW_H
|
#define MYSQL_REQUEST_ROW_H
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
//#endif
|
//#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "packet_dump.h"
|
#include "packet_dump.h"
|
||||||
#include "packet_functions.h"
|
#include "packet_functions.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include "global_define.h"
|
#include "global_define.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "proc_launcher.h"
|
#include "proc_launcher.h"
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
ProcLauncher ProcLauncher::s_launcher;
|
ProcLauncher ProcLauncher::s_launcher;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
const ProcLauncher::ProcRef ProcLauncher::ProcError = 0xFFFFFFFF;
|
const ProcLauncher::ProcRef ProcLauncher::ProcError = 0xFFFFFFFF;
|
||||||
#else
|
#else
|
||||||
const ProcLauncher::ProcRef ProcLauncher::ProcError = -1;
|
const ProcLauncher::ProcRef ProcLauncher::ProcError = -1;
|
||||||
@ -47,7 +47,7 @@ const ProcLauncher::ProcRef ProcLauncher::ProcError = -1;
|
|||||||
|
|
||||||
ProcLauncher::ProcLauncher()
|
ProcLauncher::ProcLauncher()
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if(signal(SIGCHLD, ProcLauncher::HandleSigChild) == SIG_ERR)
|
if(signal(SIGCHLD, ProcLauncher::HandleSigChild) == SIG_ERR)
|
||||||
fprintf(stderr, "Unable to register child signal handler. Thats bad.");
|
fprintf(stderr, "Unable to register child signal handler. Thats bad.");
|
||||||
m_signalCount = 0;
|
m_signalCount = 0;
|
||||||
@ -55,7 +55,7 @@ ProcLauncher::ProcLauncher()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ProcLauncher::Process() {
|
void ProcLauncher::Process() {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
std::map<ProcRef, Spec *>::iterator cur, end, tmp;
|
std::map<ProcRef, Spec *>::iterator cur, end, tmp;
|
||||||
cur = m_running.begin();
|
cur = m_running.begin();
|
||||||
end = m_running.end();
|
end = m_running.end();
|
||||||
@ -112,7 +112,7 @@ void ProcLauncher::ProcessTerminated(std::map<ProcRef, Spec *>::iterator &it) {
|
|||||||
if(it->second->handler != nullptr)
|
if(it->second->handler != nullptr)
|
||||||
it->second->handler->OnTerminate(it->first, it->second);
|
it->second->handler->OnTerminate(it->first, it->second);
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
CloseHandle(it->second->proc_info.hProcess);
|
CloseHandle(it->second->proc_info.hProcess);
|
||||||
#else //!WIN32
|
#else //!WIN32
|
||||||
#endif //!WIN32
|
#endif //!WIN32
|
||||||
@ -125,7 +125,7 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) {
|
|||||||
Spec *it = to_launch;
|
Spec *it = to_launch;
|
||||||
to_launch = nullptr;
|
to_launch = nullptr;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
STARTUPINFO siStartInfo;
|
STARTUPINFO siStartInfo;
|
||||||
BOOL bFuncRetn = FALSE;
|
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
|
//we do not remove it from the list until we have been notified
|
||||||
//that they have been terminated.
|
//that they have been terminated.
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
if(!TerminateProcess(res->second->proc_info.hProcess, 0)) {
|
if(!TerminateProcess(res->second->proc_info.hProcess, 0)) {
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ void ProcLauncher::TerminateAll(bool final) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
void ProcLauncher::HandleSigChild(int signum) {
|
void ProcLauncher::HandleSigChild(int signum) {
|
||||||
if(signum == SIGCHLD) {
|
if(signum == SIGCHLD) {
|
||||||
ProcLauncher::get()->m_signalCount++;
|
ProcLauncher::get()->m_signalCount++;
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public:
|
|||||||
static ProcLauncher *get() { return(&s_launcher); }
|
static ProcLauncher *get() { return(&s_launcher); }
|
||||||
static void ProcessInThisThread();
|
static void ProcessInThisThread();
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
typedef DWORD ProcRef;
|
typedef DWORD ProcRef;
|
||||||
static const ProcRef ProcError;
|
static const ProcRef ProcError;
|
||||||
#else
|
#else
|
||||||
@ -55,7 +55,7 @@ public:
|
|||||||
std::string logFile; //empty = do not redirect output.
|
std::string logFile; //empty = do not redirect output.
|
||||||
protected:
|
protected:
|
||||||
//None of these fields get copied around
|
//None of these fields get copied around
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
PROCESS_INFORMATION proc_info;
|
PROCESS_INFORMATION proc_info;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -83,7 +83,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static ProcLauncher s_launcher;
|
static ProcLauncher s_launcher;
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
uint32 m_signalCount;
|
uint32 m_signalCount;
|
||||||
static void HandleSigChild(int signum);
|
static void HandleSigChild(int signum);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "database.h"
|
#include "database.h"
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
int gettimeofday (timeval *tp, ...);
|
int gettimeofday (timeval *tp, ...);
|
||||||
|
|||||||
@ -121,11 +121,8 @@ private:
|
|||||||
|
|
||||||
int m_activeRuleset;
|
int m_activeRuleset;
|
||||||
std::string m_activeName;
|
std::string m_activeName;
|
||||||
#ifdef WIN64
|
|
||||||
uint32 m_RuleIntValues [_IntRuleCount ];
|
int32 m_RuleIntValues [_IntRuleCount ];
|
||||||
#else
|
|
||||||
int m_RuleIntValues [_IntRuleCount ];
|
|
||||||
#endif
|
|
||||||
float m_RuleRealValues[_RealRuleCount];
|
float m_RuleRealValues[_RealRuleCount];
|
||||||
uint32 m_RuleBoolValues[_BoolRuleCount];
|
uint32 m_RuleBoolValues[_BoolRuleCount];
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
// Implement preliminary support for *nix variants
|
// Implement preliminary support for *nix variants
|
||||||
// misanthropicfiend
|
// misanthropicfiend
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
char Ver_name[100];
|
char Ver_name[100];
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
#ifndef SERVERINFO_H
|
#ifndef SERVERINFO_H
|
||||||
#define SERVERINFO_H
|
#define SERVERINFO_H
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
extern char Ver_name[36];
|
extern char Ver_name[36];
|
||||||
extern DWORD Ver_build, Ver_min, Ver_maj, Ver_pid;
|
extern DWORD Ver_build, Ver_min, Ver_maj, Ver_pid;
|
||||||
int GetOS();
|
int GetOS();
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
#include "classes.h"
|
#include "classes.h"
|
||||||
#include "spdat.h"
|
#include "spdat.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "unix.h"
|
#include "unix.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
@ -64,7 +64,7 @@ Timer::Timer(uint32 start, uint32 timer, bool iUseAcurateTiming = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Reimplemented for MSVC - Bounce */
|
/* Reimplemented for MSVC - Bounce */
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
int gettimeofday (timeval *tp, ...)
|
int gettimeofday (timeval *tp, ...)
|
||||||
{
|
{
|
||||||
timeb tb;
|
timeb tb;
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include "global_define.h"
|
#include "global_define.h"
|
||||||
int gettimeofday (timeval *tp, ...);
|
int gettimeofday (timeval *tp, ...);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -29,7 +29,7 @@ typedef int16_t int16;
|
|||||||
typedef int32_t int32;
|
typedef int32_t int32;
|
||||||
typedef int64_t int64;
|
typedef int64_t int64;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#pragma warning( disable : 4200 )
|
#pragma warning( disable : 4200 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ typedef unsigned short ushort;
|
|||||||
typedef unsigned char uchar;
|
typedef unsigned char uchar;
|
||||||
typedef const char Const_char; //for perl XS
|
typedef const char Const_char; //for perl XS
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
|
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
@ -61,7 +61,7 @@ typedef const char Const_char; //for perl XS
|
|||||||
#define H32(i) ((uint32) (i >> 32))
|
#define H32(i) ((uint32) (i >> 32))
|
||||||
#define L16(i) ((uint16) i)
|
#define L16(i) ((uint16) i)
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
// More WIN32 compatability
|
// More WIN32 compatability
|
||||||
typedef unsigned long DWORD;
|
typedef unsigned long DWORD;
|
||||||
typedef unsigned char BYTE;
|
typedef unsigned char BYTE;
|
||||||
@ -79,14 +79,14 @@ typedef const char Const_char; //for perl XS
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define DLLFUNC extern "C" __declspec(dllexport)
|
#define DLLFUNC extern "C" __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define DLLFUNC extern "C"
|
#define DLLFUNC extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// htonll and ntohll already defined on windows
|
// htonll and ntohll already defined on windows
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
# if defined(__linux__)
|
# if defined(__linux__)
|
||||||
# include <endian.h>
|
# include <endian.h>
|
||||||
# elif defined(__FreeBSD__) || defined(__NetBSD__)
|
# elif defined(__FreeBSD__) || defined(__NetBSD__)
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifndef _WINDOWS
|
#ifndef _WIN32
|
||||||
|
|
||||||
#include "unix.h"
|
#include "unix.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifndef _WINDOWS
|
#ifndef _WIN32
|
||||||
#ifndef __UNIX_H__
|
#ifndef __UNIX_H__
|
||||||
#define __UNIX_H__
|
#define __UNIX_H__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|||||||
@ -10,16 +10,16 @@
|
|||||||
// this doesn't do shit for C++ but libc++ and GCC 6.1+ use it to define some macros
|
// this doesn't do shit for C++ but libc++ and GCC 6.1+ use it to define some macros
|
||||||
#include <ciso646>
|
#include <ciso646>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
extern "C" { //the perl headers dont do this for us...
|
extern "C" { //the perl headers dont do this for us...
|
||||||
#endif
|
#endif
|
||||||
#include <perl.h>
|
#include <perl.h>
|
||||||
#include <XSUB.h>
|
#include <XSUB.h>
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#ifndef snprintf
|
#ifndef snprintf
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#define COMPILE_DATE __DATE__
|
#define COMPILE_DATE __DATE__
|
||||||
#define COMPILE_TIME __TIME__
|
#define COMPILE_TIME __TIME__
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#define LAST_MODIFIED __TIME__
|
#define LAST_MODIFIED __TIME__
|
||||||
#else
|
#else
|
||||||
#define LAST_MODIFIED __TIMESTAMP__
|
#define LAST_MODIFIED __TIMESTAMP__
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(eqlaunch_sources
|
SET(eqlaunch_sources
|
||||||
eqlaunch.cpp
|
eqlaunch.cpp
|
||||||
|
|||||||
@ -70,7 +70,7 @@ int main(int argc, char *argv[]) {
|
|||||||
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||||
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(hc_sources
|
SET(hc_sources
|
||||||
eq.cpp
|
eq.cpp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(libuv)
|
project(libuv)
|
||||||
|
|
||||||
set(libuv_sources
|
set(libuv_sources
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(lb_sources
|
SET(lb_sources
|
||||||
src/class.cpp
|
src/class.cpp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(recast_navigation_sources
|
SET(recast_navigation_sources
|
||||||
detour/src/DetourAlloc.cpp
|
detour/src/DetourAlloc.cpp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(eqlogin_sources
|
SET(eqlogin_sources
|
||||||
client.cpp
|
client.cpp
|
||||||
@ -27,14 +27,10 @@ SET(eqlogin_headers
|
|||||||
world_server.h
|
world_server.h
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_PACKAGE(OpenSSL REQUIRED)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(loginserver ${eqlogin_sources} ${eqlogin_headers})
|
ADD_EXECUTABLE(loginserver ${eqlogin_sources} ${eqlogin_headers})
|
||||||
|
|
||||||
INSTALL(TARGETS loginserver RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
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)
|
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|||||||
@ -167,7 +167,7 @@ int main()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
SetConsoleTitle(L"EQEmu Login Server");
|
SetConsoleTitle(L"EQEmu Login Server");
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(qserv_sources
|
SET(qserv_sources
|
||||||
database.cpp
|
database.cpp
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
|
|||||||
@ -106,7 +106,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UpdateWindowTitle(char* iNewTitle) {
|
void UpdateWindowTitle(char* iNewTitle) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
char tmp[500];
|
char tmp[500];
|
||||||
if (iNewTitle) {
|
if (iNewTitle) {
|
||||||
snprintf(tmp, sizeof(tmp), "QueryServ: %s", iNewTitle);
|
snprintf(tmp, sizeof(tmp), "QueryServ: %s", iNewTitle);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(shared_memory_sources
|
SET(shared_memory_sources
|
||||||
base_data.cpp
|
base_data.cpp
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -45,7 +45,7 @@ EQEmuLogSys LogSys;
|
|||||||
|
|
||||||
inline bool MakeDirectory(const std::string &directory_name)
|
inline bool MakeDirectory(const std::string &directory_name)
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
struct _stat st;
|
struct _stat st;
|
||||||
if (_stat(directory_name.c_str(), &st) == 0) {
|
if (_stat(directory_name.c_str(), &st) == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(cppunit)
|
ADD_SUBDIRECTORY(cppunit)
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(cppunit_sources
|
SET(cppunit_sources
|
||||||
collectoroutput.cpp
|
collectoroutput.cpp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(ucs_sources
|
SET(ucs_sources
|
||||||
chatchannel.cpp
|
chatchannel.cpp
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
|
|||||||
@ -167,7 +167,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UpdateWindowTitle(char* iNewTitle) {
|
void UpdateWindowTitle(char* iNewTitle) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
char tmp[500];
|
char tmp[500];
|
||||||
if (iNewTitle) {
|
if (iNewTitle) {
|
||||||
snprintf(tmp, sizeof(tmp), "UCS: %s", iNewTitle);
|
snprintf(tmp, sizeof(tmp), "UCS: %s", iNewTitle);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(world_sources
|
SET(world_sources
|
||||||
adventure.cpp
|
adventure.cpp
|
||||||
|
|||||||
@ -60,7 +60,7 @@
|
|||||||
//#define IPBASED_AUTH_HACK
|
//#define IPBASED_AUTH_HACK
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "../common/crash.h"
|
#include "../common/crash.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "worlddb.h"
|
#include "worlddb.h"
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
@ -108,7 +108,7 @@ void CatchSignal(int sig_num);
|
|||||||
void CheckForServerScript(bool force_download = false);
|
void CheckForServerScript(bool force_download = false);
|
||||||
|
|
||||||
inline void UpdateWindowTitle(std::string new_title) {
|
inline void UpdateWindowTitle(std::string new_title) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
SetConsoleTitle(new_title.c_str());
|
SetConsoleTitle(new_title.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ int main(int argc, char** argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||||
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
|
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
@ -604,7 +604,7 @@ void CatchSignal(int sig_num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UpdateWindowTitle(char* iNewTitle) {
|
void UpdateWindowTitle(char* iNewTitle) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
char tmp[500];
|
char tmp[500];
|
||||||
if (iNewTitle) {
|
if (iNewTitle) {
|
||||||
snprintf(tmp, sizeof(tmp), "World: %s", iNewTitle);
|
snprintf(tmp, sizeof(tmp), "World: %s", iNewTitle);
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
|
||||||
|
|
||||||
SET(zone_sources
|
SET(zone_sources
|
||||||
aa.cpp
|
aa.cpp
|
||||||
|
|||||||
@ -49,7 +49,7 @@ extern QueryServ* QServ;
|
|||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern FastMath g_Math;
|
extern FastMath g_Math;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
|
|||||||
@ -109,7 +109,7 @@ int GetArgs(char * string)
|
|||||||
char *buffer = com_list;
|
char *buffer = com_list;
|
||||||
memset(temp,0x0,255);
|
memset(temp,0x0,255);
|
||||||
//memset(buffer,0x0,512);
|
//memset(buffer,0x0,512);
|
||||||
//#ifdef WIN32
|
//#ifdef _WIN32
|
||||||
//strcpy(buffer,com_list);
|
//strcpy(buffer,com_list);
|
||||||
//#else
|
//#else
|
||||||
//strncpy(buffer,com_list,sizeof(buffer)-1);
|
//strncpy(buffer,com_list,sizeof(buffer)-1);
|
||||||
|
|||||||
@ -25,7 +25,7 @@ target to center around.
|
|||||||
|
|
||||||
class Zone;
|
class Zone;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
|
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define vsnprintf _vsnprintf
|
#define vsnprintf _vsnprintf
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
#include "quest_parser_collection.h"
|
#include "quest_parser_collection.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "../common/unix.h"
|
#include "../common/unix.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
// for windows compile
|
// for windows compile
|
||||||
#ifndef _WINDOWS
|
#ifndef _WIN32
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|||||||
@ -59,7 +59,7 @@ namespace EQEmu
|
|||||||
#include "zone.h"
|
#include "zone.h"
|
||||||
#include "zonedb.h"
|
#include "zonedb.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
// since windows defines these within windef.h (which windows.h include)
|
// since windows defines these within windef.h (which windows.h include)
|
||||||
// we are required to undefine these to use min and max from <algorithm>
|
// we are required to undefine these to use min and max from <algorithm>
|
||||||
#undef min
|
#undef min
|
||||||
|
|||||||
@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -844,7 +844,7 @@ void command_setanim(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
void command_serverinfo(Client *c, const Seperator *sep)
|
void command_serverinfo(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
char intbuffer [sizeof(unsigned long)];
|
char intbuffer [sizeof(unsigned long)];
|
||||||
c->Message(0, "Operating system information.");
|
c->Message(0, "Operating system information.");
|
||||||
c->Message(0, " %s", Ver_name);
|
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");
|
c->Message(0, "Creating and applying hotfix");
|
||||||
std::thread t1([c,hotfix_name]() {
|
std::thread t1([c,hotfix_name]() {
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
if(hotfix_name.length() > 0) {
|
if(hotfix_name.length() > 0) {
|
||||||
system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str());
|
system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str());
|
||||||
} else {
|
} else {
|
||||||
@ -11856,7 +11856,7 @@ void command_load_shared_memory(Client *c, const Seperator *sep) {
|
|||||||
hotfix_name = sep->arg[1];
|
hotfix_name = sep->arg[1];
|
||||||
c->Message(0, "Loading shared memory segment %s", hotfix_name.c_str());
|
c->Message(0, "Loading shared memory segment %s", hotfix_name.c_str());
|
||||||
std::thread t1([c,hotfix_name]() {
|
std::thread t1([c,hotfix_name]() {
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
if(hotfix_name.length() > 0) {
|
if(hotfix_name.length() > 0) {
|
||||||
system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str());
|
system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -21,7 +21,7 @@ Child of the Mob class.
|
|||||||
-Quagmire
|
-Quagmire
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
|
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define vsnprintf _vsnprintf
|
#define vsnprintf _vsnprintf
|
||||||
|
|||||||
@ -22,15 +22,15 @@ Eglin
|
|||||||
#include <EXTERN.h>
|
#include <EXTERN.h>
|
||||||
#define WIN32IO_IS_STDIO
|
#define WIN32IO_IS_STDIO
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
extern "C" { //the perl headers dont do this for us...
|
extern "C" { //the perl headers dont do this for us...
|
||||||
#endif
|
#endif
|
||||||
#include <perl.h>
|
#include <perl.h>
|
||||||
#include <XSUB.h>
|
#include <XSUB.h>
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
#include <EXTERN.h>
|
#include <EXTERN.h>
|
||||||
#define WIN32IO_IS_STDIO
|
#define WIN32IO_IS_STDIO
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
extern "C" { //the perl headers dont do this for us...
|
extern "C" { //the perl headers dont do this for us...
|
||||||
#endif
|
#endif
|
||||||
#include <perl.h>
|
#include <perl.h>
|
||||||
#include <XSUB.h>
|
#include <XSUB.h>
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -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
|
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))
|
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define vsnprintf _vsnprintf
|
#define vsnprintf _vsnprintf
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#else
|
#else
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
@ -43,7 +43,7 @@
|
|||||||
#include "npc_scale_manager.h"
|
#include "npc_scale_manager.h"
|
||||||
#include "../common/say_link.h"
|
#include "../common/say_link.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
@ -532,7 +532,7 @@ void EntityList::MobProcess()
|
|||||||
entity_list.RemoveNPC(id);
|
entity_list.RemoveNPC(id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = mob->CastToClient()->GetIP();
|
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());
|
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++) {
|
for (int i=0; i < 300; i++) {
|
||||||
if (!used[i]) {
|
if (!used[i]) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
snprintf(name, 64, "%s%03d", name, i);
|
snprintf(name, 64, "%s%03d", name, i);
|
||||||
#else
|
#else
|
||||||
//glibc clears destination of snprintf
|
//glibc clears destination of snprintf
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "zone.h"
|
#include "zone.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
10
zone/net.cpp
10
zone/net.cpp
@ -84,7 +84,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
|
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#else
|
#else
|
||||||
@ -279,7 +279,7 @@ int main(int argc, char** argv) {
|
|||||||
Log(Logs::General, Logs::Error, "Could not set signal handler");
|
Log(Logs::General, Logs::Error, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||||
Log(Logs::General, Logs::Error, "Could not set signal handler");
|
Log(Logs::General, Logs::Error, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
@ -442,7 +442,7 @@ int main(int argc, char** argv) {
|
|||||||
EQStreamIdentifier stream_identifier;
|
EQStreamIdentifier stream_identifier;
|
||||||
RegisterAllPatches(stream_identifier);
|
RegisterAllPatches(stream_identifier);
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
Log(Logs::Detail, Logs::None, "Main thread running with thread id %d", pthread_self());
|
Log(Logs::Detail, Logs::None, "Main thread running with thread id %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -602,7 +602,7 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CatchSignal(int sig_num) {
|
void CatchSignal(int sig_num) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
Log(Logs::General, Logs::Zone_Server, "Recieved signal: %i", sig_num);
|
Log(Logs::General, Logs::Zone_Server, "Recieved signal: %i", sig_num);
|
||||||
#endif
|
#endif
|
||||||
RunLoops = false;
|
RunLoops = false;
|
||||||
@ -672,7 +672,7 @@ NetConnection::~NetConnection() {
|
|||||||
|
|
||||||
/* Update Window Title with relevant information */
|
/* Update Window Title with relevant information */
|
||||||
void UpdateWindowTitle(char* iNewTitle) {
|
void UpdateWindowTitle(char* iNewTitle) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
char tmp[500];
|
char tmp[500];
|
||||||
if (iNewTitle) {
|
if (iNewTitle) {
|
||||||
snprintf(tmp, sizeof(tmp), "%i: %s", ZoneConfig::get()->ZonePort, iNewTitle);
|
snprintf(tmp, sizeof(tmp), "%i: %s", ZoneConfig::get()->ZonePort, iNewTitle);
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define M_PI 3.141592
|
#define M_PI 3.141592
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -18,13 +18,13 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
|||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "../common/eqemu_logsys.h"
|
#include "../common/eqemu_logsys.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#else
|
#else
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
#include "bot.h"
|
#include "bot.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "../common/unix.h"
|
#include "../common/unix.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "../common/unix.h"
|
#include "../common/unix.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -87,7 +87,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "../common/unix.h"
|
#include "../common/unix.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -22,7 +22,7 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net)
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <netinet/in.h> //for htonl
|
#include <netinet/in.h> //for htonl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user