diff --git a/CMakeLists.txt b/CMakeLists.txt index c47168357..41300f4d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,8 @@ IF(MSVC) STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") ENDIF(${flag_var} MATCHES "/MD") ENDFOREACH(flag_var) + + ADD_DEFINITIONS(-DNOMINMAX) ELSE(MSVC) #Normally set by perl but we don't use the perl flags anymore so we set it. ADD_DEFINITIONS(-DHAS_UNION_SEMUN) @@ -125,17 +127,8 @@ OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON) #C++11 stuff IF(NOT MSVC) ADD_DEFINITIONS(-std=c++0x) - #Rvalue-Move - todo: auto set this based on gcc version - OPTION(EQEMU_ENABLE_RVALUE_MOVE "Enable EQEmu RValue References (Enable if GCC 4.3 or higher)" OFF) -ELSE(NOT MSVC) - #Rvalue-Move - todo: auto set this based on msvc version - OPTION(EQEMU_ENABLE_RVALUE_MOVE "Enable EQEmu RValue References (Enable if Visual Studio 2010 or higher)" OFF) ENDIF(NOT MSVC) -IF(EQEMU_ENABLE_RVALUE_MOVE) - ADD_DEFINITIONS(-DEQEMU_RVALUE_MOVE) -ENDIF(EQEMU_ENABLE_RVALUE_MOVE) - #Various definitions IF(EQEMU_BUILD_PERL) ADD_DEFINITIONS(-DEMBPERL) diff --git a/LICENSE.md b/LICENSE.md index ced7868b8..fd134ec9e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -The server code and utilities are released under GPL. +The server code and utilities are released under GPLv3. We also include some small libraries for convienence that may be under different licensing: @@ -9,3 +9,4 @@ ZLib - ZLib License MySQL - GPL Perl - GPL / ActiveState (under the assumption that this is a free project). CPPUnit - GLP +StringUtilities - Apache \ No newline at end of file diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index ed1a1e808..1f613a885 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -313,7 +313,6 @@ INCLUDE_DIRECTORIES(Patches SocketLib StackWalker TinyXML) ADD_LIBRARY(Common ${common_sources} ${common_headers}) - IF(UNIX) ADD_DEFINITIONS(-fPIC) SET_SOURCE_FILES_PROPERTIES("patches/SoD.cpp" "patches/SoF.cpp" "patches/RoF.cpp" "patches/Underfoot.cpp" PROPERTIES COMPILE_FLAGS -O0) diff --git a/common/EQStream.cpp b/common/EQStream.cpp index 3f68d2d69..1c17c4871 100644 --- a/common/EQStream.cpp +++ b/common/EQStream.cpp @@ -39,10 +39,6 @@ #ifdef _WINDOWS #include - // have to undefine these since a macro version - // is defined in windef.h (which windows includes) - #undef min - #undef max #else #include #include @@ -573,7 +569,7 @@ uint32 length; while (usedpBuffer+2,tmpbuff+used,chunksize); out->size=chunksize+2; SequencedPush(out); diff --git a/common/StringUtil.h b/common/StringUtil.h index bbd9d43ba..ecfacc97d 100644 --- a/common/StringUtil.h +++ b/common/StringUtil.h @@ -29,16 +29,16 @@ const char *MakeLowerString(const char *source); void MakeLowerString(const char *source, char *target); -int MakeAnyLenString(char** ret, const char* format, ...); -uint32 AppendAnyLenString(char** ret, uint32* bufsize, uint32* strlen, const char* format, ...); +int MakeAnyLenString(char** ret, const char* format, ...); +uint32 AppendAnyLenString(char** ret, uint32* bufsize, uint32* strlen, const char* format, ...); -uint32 hextoi(char* num); -uint64 hextoi64(char* num); -bool atobool(char* iBool); +uint32 hextoi(char* num); +uint64 hextoi64(char* num); +bool atobool(char* iBool); -char* strn0cpy(char* dest, const char* source, uint32 size); +char* strn0cpy(char* dest, const char* source, uint32 size); // return value =true if entire string(source) fit, false if it was truncated -bool strn0cpyt(char* dest, const char* source, uint32 size); +bool strn0cpyt(char* dest, const char* source, uint32 size); char *CleanMobName(const char *in, char *out); diff --git a/common/debug.cpp b/common/debug.cpp index e88e273e5..cb2b0ddf0 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -1,7 +1,6 @@ #include #include #include - #include #ifdef _WINDOWS diff --git a/common/rdtsc.cpp b/common/rdtsc.cpp index 15786397e..1d66c0254 100644 --- a/common/rdtsc.cpp +++ b/common/rdtsc.cpp @@ -58,7 +58,7 @@ RDTSC_Timer::RDTSC_Timer(bool start_it) { } int64 RDTSC_Timer::rdtsc() { - int64 res; + int64 res = 0; #ifdef USE_RDTSC #ifndef WIN64 #ifdef WIN32 diff --git a/eqlaunch/CMakeLists.txt b/eqlaunch/CMakeLists.txt index 6097279d2..b1575a373 100644 --- a/eqlaunch/CMakeLists.txt +++ b/eqlaunch/CMakeLists.txt @@ -16,7 +16,6 @@ ADD_EXECUTABLE(eqlaunch ${eqlaunch_sources} ${eqlaunch_headers}) TARGET_LINK_LIBRARIES(eqlaunch Common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY}) IF(MSVC) - SET_TARGET_PROPERTIES(eqlaunch PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF") TARGET_LINK_LIBRARIES(eqlaunch "Ws2_32.lib") ENDIF(MSVC) diff --git a/loginserver/CMakeLists.txt b/loginserver/CMakeLists.txt index fd13b8041..a3fad8335 100644 --- a/loginserver/CMakeLists.txt +++ b/loginserver/CMakeLists.txt @@ -13,6 +13,7 @@ SET(eqlogin_sources ) IF(MSVC OR MINGW) + ADD_DEFINITIONS(-DNOMINMAX) SET(eqlogin_sources ${eqlogin_sources} Encryption.cpp) ENDIF(MSVC OR MINGW) @@ -43,7 +44,6 @@ ADD_EXECUTABLE(loginserver ${eqlogin_sources} ${eqlogin_headers}) TARGET_LINK_LIBRARIES(loginserver Common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE}) IF(MSVC) - SET_TARGET_PROPERTIES(loginserver PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF") TARGET_LINK_LIBRARIES(loginserver "Ws2_32.lib") ENDIF(MSVC) diff --git a/loginserver/Encryption.cpp b/loginserver/Encryption.cpp index 290325ffe..c846e5130 100644 --- a/loginserver/Encryption.cpp +++ b/loginserver/Encryption.cpp @@ -18,6 +18,7 @@ #include "../common/debug.h" #include "Encryption.h" #include "ErrorLog.h" +#include #include diff --git a/queryserv/CMakeLists.txt b/queryserv/CMakeLists.txt index dca29b2cf..9be9c7544 100644 --- a/queryserv/CMakeLists.txt +++ b/queryserv/CMakeLists.txt @@ -22,7 +22,6 @@ ADD_DEFINITIONS(-DQSERV) TARGET_LINK_LIBRARIES(queryserv Common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY}) IF(MSVC) - SET_TARGET_PROPERTIES(queryserv PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF") TARGET_LINK_LIBRARIES(queryserv "Ws2_32.lib") ENDIF(MSVC) diff --git a/ucs/CMakeLists.txt b/ucs/CMakeLists.txt index 30af23655..8c86ab0d5 100644 --- a/ucs/CMakeLists.txt +++ b/ucs/CMakeLists.txt @@ -24,7 +24,6 @@ ADD_DEFINITIONS(-DUCS) TARGET_LINK_LIBRARIES(ucs Common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY}) IF(MSVC) - SET_TARGET_PROPERTIES(ucs PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF") TARGET_LINK_LIBRARIES(ucs "Ws2_32.lib") ENDIF(MSVC) diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt index 1586ca49c..6ab4e0383 100644 --- a/world/CMakeLists.txt +++ b/world/CMakeLists.txt @@ -70,7 +70,6 @@ ADD_DEFINITIONS(-DWORLD) TARGET_LINK_LIBRARIES(world Common ${PERL_LIBRARY} debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY}) IF(MSVC) - SET_TARGET_PROPERTIES(world PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF") TARGET_LINK_LIBRARIES(world "Ws2_32.lib") ENDIF(MSVC) diff --git a/zone/MobAI.cpp b/zone/MobAI.cpp index 9406409b1..fc6fd75f3 100644 --- a/zone/MobAI.cpp +++ b/zone/MobAI.cpp @@ -28,6 +28,7 @@ #include "../common/moremath.h" #include "parser.h" #include "StringIDs.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "../common/rulesys.h" #include "../common/features.h" diff --git a/zone/Object.cpp b/zone/Object.cpp index 14f7f50c3..c6c7eb3f7 100644 --- a/zone/Object.cpp +++ b/zone/Object.cpp @@ -24,6 +24,7 @@ #include "zonedb.h" #include "../common/packet_functions.h" #include "../common/packet_dump.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "../common/features.h" #include "StringIDs.h" diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 87f333b15..4a8a22be9 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -30,6 +30,7 @@ #include "questmgr.h" #include "command.h" #include "../common/seperator.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "QGlobals.h" #include "zone.h" diff --git a/zone/forage.cpp b/zone/forage.cpp index fe6247415..3c97c12a8 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -31,6 +31,7 @@ #include "watermap.h" #include "titles.h" #include "StringIDs.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "../common/rulesys.h" diff --git a/zone/merc.cpp b/zone/merc.cpp index 9af811d61..5053736aa 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -8,6 +8,7 @@ #include "../common/spdat.h" #include "zone.h" #include "StringIDs.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "../common/rulesys.h" #include "QuestParserCollection.h" diff --git a/zone/npc.cpp b/zone/npc.cpp index e540dbd96..d7a3fefea 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -40,6 +40,7 @@ #include "../common/spdat.h" #include "../common/bodytypes.h" #include "spawngroup.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "../common/rulesys.h" #include "StringIDs.h" diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 160639204..888331e1e 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -27,6 +27,7 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net) #define strcasecmp _stricmp #endif +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "../common/rulesys.h" #include "masterentity.h" diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index dccf2bf53..6eaa717ad 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -30,6 +30,7 @@ #include "../common/packet_dump.h" #include "titles.h" #include "StringIDs.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "../common/rulesys.h" #include "QuestParserCollection.h" diff --git a/zone/trap.cpp b/zone/trap.cpp index e8cf5d18f..f8818d9f9 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -20,6 +20,7 @@ #include "entity.h" #include "masterentity.h" #include "../common/spdat.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" /* diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 9e40e3a04..3046a8ad0 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -30,6 +30,7 @@ #include "../common/moremath.h" #include "parser.h" #include "StringIDs.h" +#include "../common/MiscFunctions.h" #include "../common/StringUtil.h" #include "../common/rulesys.h" #include "../common/features.h"