1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-01 01:09:39 +00:00

[Server] Fix GCC build

This commit is contained in:
Koncord 2018-12-29 15:54:08 +08:00
parent 9343b8af2f
commit 4ce0331f1b
2 changed files with 9 additions and 5 deletions

View file

@ -110,10 +110,10 @@ template<> struct F_<3> { static constexpr LuaFuctionData F{"CallPublic", LangLu
template<unsigned int I> template<unsigned int I>
struct C struct C
{ {
constexpr C(LuaFuctionData *functions_) constexpr static void Fn(LuaFuctionData *functions_)
{ {
functions_[I] = F_<I>::F; functions_[I] = F_<I>::F;
C<I - 1>::C(functions_); C<I - 1>::Fn(functions_);
} }
}; };
@ -121,7 +121,7 @@ struct C
template<> template<>
struct C<0> struct C<0>
{ {
constexpr C(LuaFuctionData *functions_) constexpr static void Fn(LuaFuctionData *functions_)
{ {
functions_[0] = F_<0>::F; functions_[0] = F_<0>::F;
} }
@ -132,7 +132,7 @@ LuaFuctionData *functions()
{ {
static LuaFuctionData functions_[LastI]; static LuaFuctionData functions_[LastI];
C<LastI - 1>::C(functions_); C<LastI - 1>::Fn(functions_);
static_assert( static_assert(
sizeof(functions_) / sizeof(functions_[0]) == sizeof(functions_) / sizeof(functions_[0]) ==

View file

@ -103,9 +103,13 @@ struct CallbackIdentity
struct ScriptFunctionPointer : public ScriptIdentity struct ScriptFunctionPointer : public ScriptIdentity
{ {
void *addr; void *addr;
#if (!defined(__clang__) && defined(__GNUC__))
template<typename R, typename... Types>
constexpr ScriptFunctionPointer(Function<R, Types...> addr) : ScriptIdentity(addr), addr(reinterpret_cast<void*>(addr)) {}
#else
template<typename R, typename... Types> template<typename R, typename... Types>
constexpr ScriptFunctionPointer(Function<R, Types...> addr) : ScriptIdentity(addr), addr(addr) {} constexpr ScriptFunctionPointer(Function<R, Types...> addr) : ScriptIdentity(addr), addr(addr) {}
#endif
}; };
struct ScriptFunctionData struct ScriptFunctionData