[Server] Remove CallFF dependency as it not fully supported by Windows and MacOS

pull/484/head
Koncord 6 years ago
parent 585557ad8a
commit b83e4056a8

@ -1,12 +1,5 @@
project(tes3mp-server)
if(UNIX) #temporarily disabled for non-unix
if(NOT (${CMAKE_CXX_COMPILER} MATCHES "aarch64" OR ${CMAKE_CXX_COMPILER} MATCHES "arm")) #temporarily disabled for arm
find_package(CallFF REQUIRED)
include_directories(${CallFF_INCLUDES})
endif(NOT (${CMAKE_CXX_COMPILER} MATCHES "aarch64" OR ${CMAKE_CXX_COMPILER} MATCHES "arm"))
endif(UNIX)
option(ENABLE_BREAKPAD "Enable Google Breakpad for Crash reporting" OFF)
if(ENABLE_BREAKPAD)
@ -80,7 +73,6 @@ set(SERVER_HEADER
Script/ScriptFunctions.hpp Script/API/TimerAPI.hpp Script/API/PublicFnAPI.hpp
${LuaScript_Headers}
${NativeScript_Headers}
${CallFF_INCLUDES}
)
source_group(tes3mp-server FILES ${SERVER} ${SERVER_HEADER})
@ -171,7 +163,6 @@ target_link_libraries(tes3mp-server
components
${LuaJit_LIBRARIES}
${Breakpad_Library}
${CallFF_LIBRARY}
)
if (UNIX)

@ -6,10 +6,6 @@
#include <stdexcept>
#include "ScriptFunction.hpp"
#if !defined(_WIN32) && !defined(__ARM_ARCH) // temporarily disabled
#include <call.hpp>
#endif
#if defined (ENABLE_LUA)
#include "LangLua/LangLua.hpp"
#endif
@ -72,46 +68,6 @@ boost::any ScriptFunction::Call(const vector<boost::any> &args)
}
}
#endif
else
{
#if !defined(_WIN32) && !defined(__ARM_ARCH) // temporarily disabled
string::iterator it;
vector<boost::any>::const_iterator it2;
vector<intptr_t> data;
CallArgs callArgs;
for (it = def.begin(), it2 = args.begin(); it != def.end(); ++it, ++it2)
{
switch (*it)
{
case 'i':
callArgs.push_integer(boost::any_cast<unsigned int>(*it2));
break;
case 'q':
callArgs.push_integer(boost::any_cast<signed int>(*it2));
break;
case 'f':
callArgs.push_double(boost::any_cast<double>(*it2));
break;
case 'd':
callArgs.push_double(boost::any_cast<double*>(*it2));
break;
case 's':
callArgs.push_stringPtr(boost::any_cast<const char *>(*it2));
break;
case 'v':
result = boost::any();
break;
default:
throw runtime_error("C++ call: Unknown argument identifier " + *it);
}
}
Func f = reinterpret_cast<Func>(fCpp);
result = ::Call(f, callArgs);
#else
throw runtime_error("C++ call: Windows and ARM not supported yet.");
#endif
}
return result;
}

Loading…
Cancel
Save