diff --git a/CMakeLists.txt b/CMakeLists.txt index 28295fd..d777da4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,6 @@ elseif (WIN32) # completely cross platform. For fixes to common issues arising from /permissive- visit: # https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /permissive-") - # disables warnings about _s variants of stdc functions - add_definitions(_CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE) endif () find_package(Boost 1.71.0 REQUIRED COMPONENTS system thread) diff --git a/src/Lua/LuaSystem.cpp b/src/Lua/LuaSystem.cpp index 48df26c..d2f52d2 100644 --- a/src/Lua/LuaSystem.cpp +++ b/src/Lua/LuaSystem.cpp @@ -12,6 +12,7 @@ #include #include #include +#include std::unique_ptr CreateArg(lua_State* L, int T, int S) { if (S > T) @@ -566,21 +567,13 @@ int CallFunction(Lua* lua, const std::string& FuncName, std::unique_ptr Size = int(Arg->args.size()); Arg->PushArgs(luaState); } - int R = 0; std::string Origin = lua->GetOrigin(); -#ifdef WIN32 - __try { -#endif // WIN32 - R = lua_pcall(luaState, Size, 1, 0); - if (CheckLua(luaState, R)) { - if (lua_isnumber(luaState, -1)) { - return int(lua_tointeger(luaState, -1)); - } + int R = lua_pcall(luaState, Size, 1, 0); + if (CheckLua(luaState, R)) { + if (lua_isnumber(luaState, -1)) { + return int(lua_tointeger(luaState, -1)); } -#ifdef WIN32 - } __except (Handle(GetExceptionInformation(), Origin.data())) { } -#endif // WIN32 } ClearStack(luaState); return 0; diff --git a/src/Network/TCPHandler.cpp b/src/Network/TCPHandler.cpp index 2c8914e..d4d5ed3 100644 --- a/src/Network/TCPHandler.cpp +++ b/src/Network/TCPHandler.cpp @@ -71,13 +71,7 @@ void TCPClient(Client*c){ } OnConnect(c); while (c->GetStatus() > -1)TCPRcv(c); -#ifdef WIN32 - __try{ -#endif // WIN32 - OnDisconnect(c, c->GetStatus() == -2); -#ifdef WIN32 - }__except(Handle(GetExceptionInformation(),Sec("OnDisconnect"))){} -#endif // WIN32 + OnDisconnect(c, c->GetStatus() == -2); } void InitClient(Client*c){ std::thread NewClient(TCPClient,c);