mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 12:45:36 +00:00
Windows compile fix
This commit is contained in:
parent
36db73b562
commit
fbbdc084a4
@ -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)
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <future>
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
#include <optional>
|
||||
|
||||
std::unique_ptr<LuaArg> 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<LuaArg>
|
||||
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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user