mirror of
https://github.com/edubart/otclient.git
synced 2026-01-16 18:41:30 +01:00
Compile with clang and add cotire
* Add cotire cmake module to speedup compilation https://github.com/sakra/cotire * Fix clang error and warnings * Rename Font to BitmapFont to fix conflict with Xlib.g Font typedef * Remove legacy PCH support * Improve Position hash
This commit is contained in:
@@ -95,7 +95,7 @@ namespace luabinder
|
||||
template<typename Ret, typename F, typename Tuple>
|
||||
LuaCppFunction bind_fun_specializer(const F& f) {
|
||||
enum { N = std::tuple_size<Tuple>::value };
|
||||
return [=](LuaInterface* lua) {
|
||||
return [=](LuaInterface* lua) -> int {
|
||||
if(lua->stackSize() != N)
|
||||
throw LuaBadNumberOfArgumentsException(N, lua->stackSize());
|
||||
Tuple tuple;
|
||||
@@ -248,7 +248,7 @@ namespace luabinder
|
||||
template<typename C>
|
||||
LuaCppFunction bind_mem_fun(int (C::*f)(LuaInterface*)) {
|
||||
auto mf = std::mem_fn(f);
|
||||
return [=](LuaInterface* lua) {
|
||||
return [=](LuaInterface* lua) -> int {
|
||||
auto obj = lua->castValue<std::shared_ptr<C>>(1);
|
||||
lua->remove(1);
|
||||
return mf(obj, lua);
|
||||
|
||||
@@ -53,7 +53,7 @@ void LuaInterface::init()
|
||||
bindClassMemberFunction<LuaObject>("getUseCount", &LuaObject::getUseCount);
|
||||
bindClassMemberFunction<LuaObject>("getClassName", &LuaObject::getClassName);
|
||||
|
||||
registerClassMemberFunction<LuaObject>("getFieldsTable", (LuaCppFunction) ([](LuaInterface* lua) {
|
||||
registerClassMemberFunction<LuaObject>("getFieldsTable", (LuaCppFunction) ([](LuaInterface* lua) -> int {
|
||||
LuaObjectPtr obj = g_lua.popObject();
|
||||
obj->luaGetFieldsTable();
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user