diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 1e845441a..333528b64 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -23,7 +23,6 @@ #include "common/events/player_event_logs.h" #include "common/evolving_items.h" #include "common/file.h" -#include "common/global_define.h" #include "common/path_manager.h" #include "common/platform.h" #include "common/repositories/base_data_repository.h" diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index e24cdff8e..b09eba064 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -23,7 +23,6 @@ #include "common/events/player_event_logs.h" #include "common/evolving_items.h" #include "common/file.h" -#include "common/global_define.h" #include "common/path_manager.h" #include "common/platform.h" #include "common/repositories/base_data_repository.h" diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 22dd6f903..3f8b29934 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -604,7 +604,6 @@ set(common_headers file.h fixed_memory_hash_set.h fixed_memory_variable_hash_set.h - global_define.h guild_base.h guilds.h http/httplib.h diff --git a/common/StackWalker/StackWalker.h b/common/StackWalker/StackWalker.h index 0c3236ffb..ec233d9fa 100644 --- a/common/StackWalker/StackWalker.h +++ b/common/StackWalker/StackWalker.h @@ -14,7 +14,7 @@ // so we need not to check the version (because we only support _MSC_VER >= 1100)! #pragma once -#include +#include "common/platform/win/include_windows.h" // special defines for VC5/6 (if no actual PSDK is installed): #if _MSC_VER < 1300 diff --git a/common/base_packet.cpp b/common/base_packet.cpp index 15608c2bb..0fdfe22c1 100644 --- a/common/base_packet.cpp +++ b/common/base_packet.cpp @@ -17,7 +17,6 @@ */ #include "common/base_packet.h" -#include "common/global_define.h" #include "common/misc.h" #include "common/packet_dump.h" diff --git a/common/base_packet.h b/common/base_packet.h index 803f37b8d..463bc2faf 100644 --- a/common/base_packet.h +++ b/common/base_packet.h @@ -18,20 +18,11 @@ #pragma once +#include "common/platform/inet.h" #include "common/serialize_buffer.h" #include "common/types.h" #include -#include - -#ifdef _WINDOWS - #include - #include - #include -#else - #include - #include -#endif class BasePacket { public: diff --git a/common/bodytypes.cpp b/common/bodytypes.cpp index 9de4130f4..650f25f58 100644 --- a/common/bodytypes.cpp +++ b/common/bodytypes.cpp @@ -1,7 +1,5 @@ #include "bodytypes.h" -#include "common/global_define.h" - std::string BodyType::GetName(uint8 body_type_id) { return IsValid(body_type_id) ? body_type_names[body_type_id] : "UNKNOWN BODY TYPE"; diff --git a/common/classes.cpp b/common/classes.cpp index 704c3c97f..babd08d64 100644 --- a/common/classes.cpp +++ b/common/classes.cpp @@ -19,7 +19,6 @@ #include "classes.h" #include "common/data_verification.h" -#include "common/global_define.h" #include "fmt/format.h" diff --git a/common/compression.cpp b/common/compression.cpp index 2f8233b28..7b4587461 100644 --- a/common/compression.cpp +++ b/common/compression.cpp @@ -1,6 +1,5 @@ #include "compression.h" -#include "common/global_define.h" #include "common/types.h" #include "zlib.h" diff --git a/common/condition.h b/common/condition.h index 7402589e7..aba13eb12 100644 --- a/common/condition.h +++ b/common/condition.h @@ -18,11 +18,9 @@ #pragma once -#include "common/global_define.h" #include "common/mutex.h" -#ifndef WIN32 -#include -#endif +#include "common/platform/posix/include_pthreads.h" +#include "common/platform/win/include_windows.h" //Sombody, someday needs to figure out how to implement a condition //system on windows... diff --git a/common/crash.cpp b/common/crash.cpp index 93eb739ea..7cde8bb30 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -2,7 +2,6 @@ #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/http/httplib.h" #include "common/http/uri.h" #include "common/json/json.h" @@ -16,10 +15,6 @@ #include #include -#ifdef _WINDOWS -#define popen _popen -#endif - void SendCrashReport(const std::string &crash_report) { // can configure multiple endpoints if need be diff --git a/common/database.cpp b/common/database.cpp index e0532037d..7850dd896 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -22,9 +22,9 @@ #include "common/eq_packet_structs.h" #include "common/events/player_event_logs.h" #include "common/extprofile.h" -#include "common/global_define.h" #include "common/http/httplib.h" #include "common/http/uri.h" +#include "common/platform/win/include_windows.h" #include "common/repositories/account_repository.h" #include "common/repositories/adventure_stats_repository.h" #include "common/repositories/bot_data_repository.h" @@ -56,29 +56,9 @@ #include "common/strings.h" #include "common/zone_store.h" -#include "mysqld_error.h" - -#include -#include -#include -#include -#include -#include #include #include -// Disgrace: for windows compile -#ifdef _WINDOWS -#include -#define snprintf _snprintf -#define strncasecmp _strnicmp -#define strcasecmp _stricmp -#else -#include "unix.h" -#include -#include -#endif - extern Client client; Database::Database() { } diff --git a/common/database.h b/common/database.h index 8a0f333d0..425cb5818 100644 --- a/common/database.h +++ b/common/database.h @@ -21,7 +21,6 @@ #include "common/dbcore.h" #include "common/eq_packet_structs.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/linked_list.h" #include "common/types.h" diff --git a/common/database/database_dump_service.cpp b/common/database/database_dump_service.cpp index dc36040ee..ae66afff9 100644 --- a/common/database/database_dump_service.cpp +++ b/common/database/database_dump_service.cpp @@ -28,17 +28,10 @@ #include "common/strings.h" #include "common/termcolor/rang.hpp" -#include #include #include #include -#if _WIN32 -#include -#else -#include -#include -#endif #define DATABASE_DUMP_PATH "backups/" diff --git a/common/database_instances.cpp b/common/database_instances.cpp index 05af2aecc..117e47b42 100644 --- a/common/database_instances.cpp +++ b/common/database_instances.cpp @@ -18,7 +18,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "database.h" -#include "common/global_define.h" +#include "common/platform/inet.h" +#include "common/platform/platform" +#include "common/platform/win/include_windows.h" #include "common/repositories/character_corpses_repository.h" #include "common/repositories/data_buckets_repository.h" #include "common/repositories/dynamic_zone_members_repository.h" @@ -34,22 +36,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "common/rulesys.h" #include "common/strings.h" #include "common/timer.h" - -#include -#include - -// Disgrace: for windows compile -#ifdef _WINDOWS -#include -#define snprintf _snprintf -#define strncasecmp _strnicmp -#define strcasecmp _stricmp -#else #include "common/unix.h" #include "zone/zonedb.h" -#include -#include -#endif + bool Database::AddClientToInstance(uint16 instance_id, uint32 character_id) diff --git a/common/emu_opcodes.cpp b/common/emu_opcodes.cpp index 6e9ad93f8..c39952cc8 100644 --- a/common/emu_opcodes.cpp +++ b/common/emu_opcodes.cpp @@ -17,7 +17,6 @@ */ #include "common/emu_opcodes.h" -#include "common/global_define.h" const char *OpcodeNames[_maxEmuOpcode+1] = { "OP_Unknown", diff --git a/common/eq_packet.cpp b/common/eq_packet.cpp index f8797b67d..1c494950c 100644 --- a/common/eq_packet.cpp +++ b/common/eq_packet.cpp @@ -18,7 +18,6 @@ #include "eq_packet.h" -#include "common/global_define.h" #include "common/misc.h" #include "common/op_codes.h" #ifndef STATIC_OPCODE diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index f07a54533..f6de9ca45 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -2,7 +2,6 @@ #include "common/eq_stream_ident.h" #include "common/eq_stream_proxy.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/misc.h" #include diff --git a/common/eq_stream_proxy.cpp b/common/eq_stream_proxy.cpp index e2e088491..f497e0e57 100644 --- a/common/eq_stream_proxy.cpp +++ b/common/eq_stream_proxy.cpp @@ -2,7 +2,6 @@ #include "eq_stream_proxy.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/opcodemgr.h" #include "common/struct_strategy.h" diff --git a/common/eqdb.cpp b/common/eqdb.cpp index f2a4b8a52..05b82b644 100644 --- a/common/eqdb.cpp +++ b/common/eqdb.cpp @@ -19,7 +19,6 @@ #include "eqdb.h" #include "common/database.h" -#include "common/global_define.h" #include "mysql.h" #include diff --git a/common/eqdb_res.cpp b/common/eqdb_res.cpp index 1fc7b2ecb..2229fa06c 100644 --- a/common/eqdb_res.cpp +++ b/common/eqdb_res.cpp @@ -18,7 +18,6 @@ #include "eqdb_res.h" -#include "common/global_define.h" #include "mysql.h" std::vector EQDBRes::fetch_row_array() { diff --git a/common/eqemu_config.cpp b/common/eqemu_config.cpp index 963607ace..db3faa642 100644 --- a/common/eqemu_config.cpp +++ b/common/eqemu_config.cpp @@ -19,7 +19,6 @@ #include "eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/json/json.hpp" #include "common/misc_functions.h" #include "common/strings.h" diff --git a/common/eqtime.cpp b/common/eqtime.cpp index 7fc34315c..001cdb837 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -20,19 +20,11 @@ #include "common/eq_packet_structs.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include #include #include - /*#ifdef _CRTDBG_MAP_ALLOC - #undef new - #endif*/ - /*#ifdef _CRTDBG_MAP_ALLOC - #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) - #endif*/ - #define EQT_VERSION 1000 //Constructor diff --git a/common/event/event_loop.h b/common/event/event_loop.h index 8d7ee6a0d..4ef532d98 100644 --- a/common/event/event_loop.h +++ b/common/event/event_loop.h @@ -1,8 +1,7 @@ #pragma once -#include "uv.h" - -#include +#include "common/platform/win/include_windows.h" // uv.h is going to include it so lets do it first. +#include "uv.h" // FIXME: hide this namespace EQ { diff --git a/common/extprofile.cpp b/common/extprofile.cpp index 5fd4d4471..a4c8727a7 100644 --- a/common/extprofile.cpp +++ b/common/extprofile.cpp @@ -18,8 +18,6 @@ #include "extprofile.h" -#include "common/global_define.h" - //Set defaults in the extended profile... void InitExtendedProfile(ExtendedProfile_Struct *p) { memset(p, 0, sizeof(ExtendedProfile_Struct)); diff --git a/common/global_define.h b/common/global_define.h index 8c4755d84..350225ca5 100644 --- a/common/global_define.h +++ b/common/global_define.h @@ -17,17 +17,3 @@ */ #pragma once - -// WHY IS THIS UP HERE -#if defined(_DEBUG) && defined(WIN32) - #ifndef _CRTDBG_MAP_ALLOC - #include - #include - #endif -#endif - - -#ifdef _WINDOWS - #include - #include -#endif diff --git a/common/misc.cpp b/common/misc.cpp index 5927dbb41..52e5086bb 100644 --- a/common/misc.cpp +++ b/common/misc.cpp @@ -1,6 +1,5 @@ #include "misc.h" -#include "common/global_define.h" #include "common/strings.h" #include "common/types.h" @@ -12,9 +11,6 @@ #include #include #include -#ifndef WIN32 -#include -#endif std::map DBFieldNames; @@ -341,23 +337,6 @@ char *bptr; return (bptr-buffer); } -std::string generate_key(int length) -{ -std::string key; -//TODO: write this for win32... -#ifndef WIN32 -int i; -timeval now; - static const char *chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - for(i=0;i -#include - +#include +#include #define snprintf _snprintf -#define strncasecmp _strnicmp -#define strcasecmp _stricmp #else #include #include diff --git a/common/mutex.cpp b/common/mutex.cpp index 9f2fe3889..852f52343 100644 --- a/common/mutex.cpp +++ b/common/mutex.cpp @@ -18,8 +18,6 @@ #include "mutex.h" -#include "common/global_define.h" - #include #define DEBUG_MUTEX_CLASS 0 @@ -163,100 +161,3 @@ void LockMutex::lock() { mut->lock(); locked = true; } - - -MRMutex::MRMutex() { - rl = 0; - wr = 0; - rl = 0; -} - -MRMutex::~MRMutex() { -#ifdef _EQDEBUG - if (wl || rl) { - std::cout << "MRMutex::~MRMutex: poor cleanup detected: rl=" << rl << ", wl=" << wl << std::endl; - } -#endif -} - -void MRMutex::ReadLock() { - while (!TryReadLock()) { - Sleep(1); - } -} - -bool MRMutex::TryReadLock() { - MCounters.lock(); - if (!wr && !wl) { - rl++; - MCounters.unlock(); - return true; - } - else { - MCounters.unlock(); - return false; - } -} - -void MRMutex::UnReadLock() { - MCounters.lock(); - rl--; - MCounters.unlock(); -} - -void MRMutex::WriteLock() { - MCounters.lock(); - if (!rl && !wl) { - wl++; - MCounters.unlock(); - return; - } - else { - wr++; - MCounters.unlock(); - while (1) { - Sleep(1); - MCounters.lock(); - if (!rl && !wl) { - wr--; - MCounters.unlock(); - return; - } - MCounters.lock(); - } - } -} - -bool MRMutex::TryWriteLock() { - MCounters.lock(); - if (!rl && !wl) { - wl++; - MCounters.unlock(); - return true; - } - else { - MCounters.unlock(); - return false; - } -} - -void MRMutex::UnWriteLock() { - MCounters.lock(); - wl--; - MCounters.unlock(); -} - -int32 MRMutex::ReadLockCount() { - MCounters.lock(); - int32 ret = rl; - MCounters.unlock(); - return ret; -} - -int32 MRMutex::WriteLockCount() { - MCounters.lock(); - int32 ret = wl; - MCounters.unlock(); - return ret; -} - diff --git a/common/mutex.h b/common/mutex.h index d6bbac916..fc4d24873 100644 --- a/common/mutex.h +++ b/common/mutex.h @@ -19,14 +19,8 @@ #pragma once #include "common/types.h" - -#ifdef _WINDOWS -#include -#include -#else -#include "common/unix.h" -#include -#endif +#include "common/platform/posix/include_pthreads.h" +#include "common/platform/win/include_windows.h" class Mutex { public: @@ -38,7 +32,7 @@ public: bool trylock(); protected: private: -#if defined WIN32 || defined WIN64 +#if defined _WINDOWS CRITICAL_SECTION CSMutex; #else pthread_mutex_t CSMutex; @@ -55,28 +49,3 @@ private: bool locked; Mutex* mut; }; - - -// Somewhat untested... -// Multi-read, single write mutex -Quagmire -class MRMutex { -public: - MRMutex(); - ~MRMutex(); - - void ReadLock(); - bool TryReadLock(); - void UnReadLock(); - - void WriteLock(); - bool TryWriteLock(); - void UnWriteLock(); - - int32 ReadLockCount(); - int32 WriteLockCount(); -private: - int32 rl; // read locks in effect - int32 wr; // write lock requests pending - int32 wl; // write locks in effect (should never be more than 1) - Mutex MCounters; -}; diff --git a/common/opcode_map.cpp b/common/opcode_map.cpp index 8d1aae5b7..7a07551a6 100644 --- a/common/opcode_map.cpp +++ b/common/opcode_map.cpp @@ -1,5 +1,3 @@ -#include "common/global_define.h" - #include #include diff --git a/common/packet_dump_file.cpp b/common/packet_dump_file.cpp index f8e4f8ab9..5d08c983d 100644 --- a/common/packet_dump_file.cpp +++ b/common/packet_dump_file.cpp @@ -16,29 +16,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "common/global_define.h" +#include "packet_dump_file.h" +#include "common/eq_stream_intf.h" + +#include +#include +#include #include #include #include -#include -//#ifdef _CRTDBG_MAP_ALLOC -// #undef new -// #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) -//#endif -#include - -#ifdef _WINDOWS - #define snprintf _snprintf - #define strncasecmp _strnicmp - #define strcasecmp _stricmp -#else - #include -#endif - -#include "eq_stream_intf.h" -#include "packet_dump_file.h" void FileDumpPacketAscii(const char* filename, const uchar* buf, uint32 size, uint32 cols, uint32 skip) { std::ofstream logfile(filename, std::ios::app); diff --git a/common/packet_dump_file.h b/common/packet_dump_file.h index c3f3dcc17..d0e32d69a 100644 --- a/common/packet_dump_file.h +++ b/common/packet_dump_file.h @@ -20,8 +20,6 @@ #include "common/types.h" -#include - class EQApplicationPacket; void FileDumpPacketAscii(const char* filename, const uchar* buf, uint32 size, uint32 cols=16, uint32 skip=0); diff --git a/common/packet_functions.cpp b/common/packet_functions.cpp index a882107f2..4979f6d6b 100644 --- a/common/packet_functions.cpp +++ b/common/packet_functions.cpp @@ -18,16 +18,13 @@ #include "packet_functions.h" -#include "common/global_define.h" #include "common/packet_dump.h" +#include "common/platform/inet.h" #include "zlib.h" #include #include #include -#ifndef WIN32 -#include -#endif void EncryptProfilePacket(EQApplicationPacket* app) { //EncryptProfilePacket(app->pBuffer, app->size); diff --git a/common/patches/patches.cpp b/common/patches/patches.cpp index 615849972..359739788 100644 --- a/common/patches/patches.cpp +++ b/common/patches/patches.cpp @@ -19,7 +19,6 @@ #include "patches.h" -#include "common/global_define.h" #include "common/patches/rof.h" #include "common/patches/rof2.h" #include "common/patches/sod.h" diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 0e6f48861..06074a929 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -25,7 +25,6 @@ #include "common/eq_stream_ident.h" #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/inventory_profile.h" #include "common/misc_functions.h" #include "common/opcodemgr.h" diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index ecefc4632..ddddc2775 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -26,7 +26,6 @@ #include "common/eq_stream_ident.h" #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/inventory_profile.h" #include "common/misc_functions.h" #include "common/opcodemgr.h" diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 01bf5f8cf..27ffcf87d 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -25,7 +25,6 @@ #include "common/eq_stream_ident.h" #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/item_instance.h" #include "common/misc_functions.h" #include "common/opcodemgr.h" diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 1ae60f054..8c6e3d586 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -25,7 +25,6 @@ #include "common/eq_stream_ident.h" #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/item_instance.h" #include "common/misc_functions.h" #include "common/opcodemgr.h" diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 3852c8808..98c463921 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -25,7 +25,6 @@ #include "common/eq_stream_ident.h" #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/guilds.h" #include "common/item_instance.h" #include "common/misc_functions.h" diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index f12687068..4f3688161 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -26,7 +26,6 @@ #include "common/eq_stream_ident.h" #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/guilds.h" #include "common/item_instance.h" #include "common/misc_functions.h" diff --git a/common/pch/app-pch.h b/common/pch/app-pch.h index 32d2b070d..261149063 100644 --- a/common/pch/app-pch.h +++ b/common/pch/app-pch.h @@ -6,4 +6,3 @@ #include "common/eqemu_logsys.h" #include "common/eqemu_logsys_log_aliases.h" #include "common/features.h" -#include "common/global_define.h" diff --git a/common/perl_eqdb.cpp b/common/perl_eqdb.cpp index 53f3059df..7d1860c56 100644 --- a/common/perl_eqdb.cpp +++ b/common/perl_eqdb.cpp @@ -28,7 +28,6 @@ typedef const char Const_char; #ifdef EMBPERL -#include "common/global_define.h" #include "common/eqdb.h" #include "common/useperl.h" diff --git a/common/perl_eqdb_res.cpp b/common/perl_eqdb_res.cpp index 32a588ece..e55dac5ab 100644 --- a/common/perl_eqdb_res.cpp +++ b/common/perl_eqdb_res.cpp @@ -28,7 +28,6 @@ typedef const char Const_char; #ifdef EMBPERL -#include "common/global_define.h" #include "common/eqdb_res.h" #include "common/useperl.h" diff --git a/common/platform/platform.h b/common/platform/platform.h index 81624a808..38d9aac32 100644 --- a/common/platform/platform.h +++ b/common/platform/platform.h @@ -3,5 +3,5 @@ #ifdef _WINDOWS #include "common/platform/win/include_windows.h" #else -#include +#include "common/unix.h" #endif diff --git a/common/proc_launcher.cpp b/common/proc_launcher.cpp index 0be460a8e..80415fe21 100644 --- a/common/proc_launcher.cpp +++ b/common/proc_launcher.cpp @@ -18,13 +18,13 @@ #include "proc_launcher.h" -#include "common/global_define.h" #include "common/types.h" #include #include + #ifdef _WINDOWS -#include +#include "common/platform/win/include_windows.h" #else #include #include diff --git a/common/proc_launcher.h b/common/proc_launcher.h index 15ff0dd73..5f1f7efff 100644 --- a/common/proc_launcher.h +++ b/common/proc_launcher.h @@ -18,16 +18,12 @@ #pragma once -#include "common/global_define.h" +#include "common/platform/platform.h" #include #include #include -#ifdef __FreeBSD__ -#include -#endif - //I forced this object to become a singleton because it registers its //signal handler for UNIX class ProcLauncher { diff --git a/common/ptimer.cpp b/common/ptimer.cpp index dfba5f6f9..9ab6a8068 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -19,7 +19,6 @@ #include "ptimer.h" #include "common/database.h" -#include "common/global_define.h" #include "common/strings.h" #include "common/timer.h" diff --git a/common/repositories/character_evolving_items_repository.h b/common/repositories/character_evolving_items_repository.h index 7a039dcad..08dc95c89 100644 --- a/common/repositories/character_evolving_items_repository.h +++ b/common/repositories/character_evolving_items_repository.h @@ -5,8 +5,6 @@ #include "common/database.h" #include "common/strings.h" -#include - class CharacterEvolvingItemsRepository: public BaseCharacterEvolvingItemsRepository { public: // Custom extended repository methods here diff --git a/common/repositories/character_expedition_lockouts_repository.h b/common/repositories/character_expedition_lockouts_repository.h index 6bc0f9189..4318dbbef 100644 --- a/common/repositories/character_expedition_lockouts_repository.h +++ b/common/repositories/character_expedition_lockouts_repository.h @@ -5,6 +5,7 @@ #include "common/database.h" #include "common/dynamic_zone_lockout.h" #include "common/strings.h" +#include "fmt/ranges.h" #include diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index 12372a6e2..0c7dc04dd 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -2,7 +2,6 @@ #include "common/eq_stream_intf.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/opcodemgr.h" #include diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index ab0746d16..b1b3d3e20 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -18,8 +18,6 @@ #include "timeoutmgr.h" -#include "common/global_define.h" - //#define TIMEOUT_DEBUG Timeoutable::Timeoutable(uint32 check_frequency) diff --git a/common/timer.cpp b/common/timer.cpp index 32911f9d9..63b8d6d4b 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -20,9 +20,11 @@ // Disgrace: for windows compile #ifndef WIN32 - #include +#include #else - #include +#include +#include +#undef GetCurrentTime #endif uint32 current_time = 0; diff --git a/common/timer.h b/common/timer.h index 9a2e2765a..e7c343c8a 100644 --- a/common/timer.h +++ b/common/timer.h @@ -22,8 +22,8 @@ // Disgrace: for windows compile #ifdef _WINDOWS - #include "global_define.h" - int gettimeofday (timeval *tp, ...); +struct timeval; +int gettimeofday (timeval *tp, ...); #endif #include diff --git a/common/util/win_dirent.h b/common/util/win_dirent.h index 89f4df49f..cc78344ce 100644 --- a/common/util/win_dirent.h +++ b/common/util/win_dirent.h @@ -14,10 +14,7 @@ * Include windows.h without Windows Sockets 1.1 to prevent conflicts with * Windows Sockets 2.0. */ -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif -#include +#include "common/platform/win/include_windows.h" #include #include diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 864852c69..df5bad2f1 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -19,7 +19,6 @@ #include "common/crash.h" #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/path_manager.h" #include "common/platform.h" #include "common/proc_launcher.h" @@ -28,11 +27,10 @@ #include "eqlaunch/worldserver.h" #include "eqlaunch/zone_launch.h" -#include +#include +#include #include #include -#include -#include bool RunLoops = false; diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index ae365c924..d51841ba3 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "common/servertalk.h" #include "common/strings.h" #include "eqlaunch/zone_launch.h" diff --git a/eqlaunch/zone_launch.cpp b/eqlaunch/zone_launch.cpp index 84f7ac563..c848be2ef 100644 --- a/eqlaunch/zone_launch.cpp +++ b/eqlaunch/zone_launch.cpp @@ -20,7 +20,6 @@ #include "common/eqemu_config.h" #include "common/eqemu_logsys.h" -#include "common/global_define.h" #include "eqlaunch/worldserver.h" //static const uint32 ZONE_RESTART_DELAY = 10000;