Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Nov 10, 2024
1 parent 13850ee commit 3a8bed8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
26 changes: 13 additions & 13 deletions ElunaTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ template<> inline int ElunaTemplate<unsigned long long>::Mod(lua_State* L) { ret
template<> inline int ElunaTemplate<unsigned long long>::Equal(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::equal_to<unsigned long long>()); }
template<> inline int ElunaTemplate<unsigned long long>::Less(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::less<unsigned long long>()); }
template<> inline int ElunaTemplate<unsigned long long>::LessOrEqual(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::less_equal<unsigned long long>()); }
template<> inline int ElunaTemplate<unsigned long long>::ToString(lua_State* L) { return ToStringHelper<unsigned long long>(L); }
template<> inline int ElunaTemplate<unsigned long long>::Pow(lua_State* L) { return PowHelper<unsigned long long>(L); }
template<> inline int ElunaTemplate<unsigned long long>::ToString(lua_State* L) { return ToStringHelper(L); }
template<> inline int ElunaTemplate<unsigned long long>::Pow(lua_State* L) { return PowHelper(L); }

template<> inline int ElunaTemplate<long long>::Add(lua_State* L) { return PerformBinaryOp<long long>(L, std::plus<long long>()); }
template<> inline int ElunaTemplate<long long>::Subtract(lua_State* L) { return PerformBinaryOp<long long>(L, std::minus<long long>()); }
template<> inline int ElunaTemplate<long long>::Multiply(lua_State* L) { return PerformBinaryOp<long long>(L, std::multiplies<long long>()); }
template<> inline int ElunaTemplate<long long>::Divide(lua_State* L) { return PerformBinaryOp<long long>(L, std::divides<long long>()); }
template<> inline int ElunaTemplate<long long>::Mod(lua_State* L) { return PerformBinaryOp<long long>(L, std::modulus<long long>()); }
template<> inline int ElunaTemplate<long long>::UnaryMinus(lua_State* L) { return PerformUnaryOp<long long>(L, std::negate<long long>()); }
template<> inline int ElunaTemplate<long long>::Equal(lua_State* L) { return PerformBinaryOp<long long>(L, std::equal_to<long long>()); }
template<> inline int ElunaTemplate<long long>::Less(lua_State* L) { return PerformBinaryOp<long long>(L, std::less<long long>()); }
template<> inline int ElunaTemplate<long long>::LessOrEqual(lua_State* L) { return PerformBinaryOp<long long>(L, std::less_equal<long long>()); }
template<> inline int ElunaTemplate<long long>::ToString(lua_State* L) { return ToStringHelper<long long>(L); }
template<> inline int ElunaTemplate<long long>::Pow(lua_State* L) { return PowHelper<long long>(L); }
template<> inline int ElunaTemplate<long long>::Add(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::plus<long long>()); }
template<> inline int ElunaTemplate<long long>::Subtract(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::minus<long long>()); }
template<> inline int ElunaTemplate<long long>::Multiply(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::multiplies<long long>()); }
template<> inline int ElunaTemplate<long long>::Divide(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::divides<long long>()); }
template<> inline int ElunaTemplate<long long>::Mod(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::modulus<long long>()); }
template<> inline int ElunaTemplate<long long>::UnaryMinus(lua_State* L) { return PerformUnaryOp<unsigned long long>(L, std::negate<long long>()); }
template<> inline int ElunaTemplate<long long>::Equal(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::equal_to<long long>()); }
template<> inline int ElunaTemplate<long long>::Less(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::less<long long>()); }
template<> inline int ElunaTemplate<long long>::LessOrEqual(lua_State* L) { return PerformBinaryOp<unsigned long long>(L, std::less_equal<long long>()); }
template<> inline int ElunaTemplate<long long>::ToString(lua_State* L) { return ToStringHelper(L); }
template<> inline int ElunaTemplate<long long>::Pow(lua_State* L) { return PowHelper(L); }

template<> inline int ElunaTemplate<ObjectGuid>::Equal(lua_State* L) { Eluna* E = Eluna::GetEluna(L); E->Push(E->CHECKVAL<ObjectGuid>(1) == E->CHECKVAL<ObjectGuid>(2)); return 1; }
template<> inline int ElunaTemplate<ObjectGuid>::ToString(lua_State* L)
Expand Down
14 changes: 6 additions & 8 deletions ElunaTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ class ElunaTemplate
return 1;
}

template <typename T>
static int PerformBinaryOp(lua_State* L, std::function<T(T, T)> binaryOp)
template<typename F>
static int PerformBinaryOp(lua_State* L, std::function<F(F, F)> binaryOp)
{
Eluna* E = Eluna::GetEluna(L);

Expand All @@ -485,17 +485,16 @@ class ElunaTemplate
return 1;
}

template <typename T>
static int PerformUnaryOp(lua_State* L, std::function<T(T)> unaryOp)
template<typename F>
static int PerformUnaryOp(lua_State* L, std::function<F(F)> unaryOp)
{
Eluna* E = Eluna::GetEluna(L);

T val1 = E->CHECKVAL<T>(1);
E->Push(unaryOp(val1));
T val = E->CHECKVAL<T>(1);
E->Push(unaryOp(val));
return 1;
}

template <typename T>
static int ToStringHelper(lua_State* L)
{
Eluna* E = Eluna::GetEluna(L);
Expand All @@ -507,7 +506,6 @@ class ElunaTemplate
return 1;
}

template <typename T>
static int PowHelper(lua_State* L)
{
Eluna* E = Eluna::GetEluna(L);
Expand Down

0 comments on commit 3a8bed8

Please sign in to comment.