Doesn't compile with eris lua yet. Getting closer.
This commit is contained in:
@@ -207,17 +207,6 @@ extern LuaNilMarker LuaNil;
|
||||
class LuaNewTableMarker {};
|
||||
extern LuaNewTableMarker LuaNewTable;
|
||||
|
||||
class LuaDiscardMarker {};
|
||||
extern LuaDiscardMarker LuaDiscard;
|
||||
|
||||
struct LuaAcceptNilNumber { lua_Number v; };
|
||||
struct LuaAcceptNilInteger { lua_Integer v; };
|
||||
struct LuaAcceptNilString { std::string v; };
|
||||
|
||||
inline LuaAcceptNilNumber &LuaAcceptNil(lua_Number &x) { return *(LuaAcceptNilNumber *)(&x); }
|
||||
inline LuaAcceptNilInteger &LuaAcceptNil(lua_Integer &x) { return *(LuaAcceptNilInteger *)(&x); }
|
||||
inline LuaAcceptNilString &LuaAcceptNil(std::string &x) { return *(LuaAcceptNilString *)(&x); }
|
||||
|
||||
using LuaDeleterFn = void (*)(void *);
|
||||
|
||||
using LuaTypeTag = lua_CFunction;
|
||||
@@ -303,13 +292,9 @@ private:
|
||||
|
||||
// Pop any value off the stack, by type.
|
||||
void pop_any_value(LuaSlot &s) const { lua_replace(L_, s); }
|
||||
void pop_any_value(lua_Integer &s) const { s = luaL_ckinteger(L_, -1); lua_pop(L_, 1); }
|
||||
void pop_any_value(lua_Number &s) const { s = luaL_cknumber(L_, -1); lua_pop(L_, 1); }
|
||||
void pop_any_value(lua_Integer &s) const;
|
||||
void pop_any_value(lua_Number &s) const;
|
||||
void pop_any_value(std::string &s) const;
|
||||
void pop_any_value(LuaAcceptNilNumber &s) const;
|
||||
void pop_any_value(LuaAcceptNilInteger &s) const;
|
||||
void pop_any_value(LuaAcceptNilString &s) const;
|
||||
void pop_any_value(LuaDiscardMarker &s) const { lua_pop(L_, 1); }
|
||||
|
||||
// Push multiple values on the stack, in order, by type.
|
||||
template<typename T0, typename... T>
|
||||
@@ -342,11 +327,6 @@ private:
|
||||
pop_any_value(s);
|
||||
}
|
||||
template<int NRET, typename... T>
|
||||
void call_cfunction(int otop, LuaDiscardMarker &s, T... args) {
|
||||
call_cfunction<NRET+1>(otop, args...);
|
||||
pop_any_value(s);
|
||||
}
|
||||
template<int NRET, typename... T>
|
||||
void call_cfunction(int otop, lua_CFunction fn, T... args) {
|
||||
push_any_values(args...);
|
||||
int nret = fn(L_);
|
||||
@@ -397,11 +377,11 @@ public:
|
||||
void checkboolean(LuaSlot index) const { checktype(index, LUA_TBOOLEAN); }
|
||||
void checknil(LuaSlot index) const { checktype(index, LUA_TNIL); }
|
||||
|
||||
lua_Integer ckinteger(LuaSlot s) const { return luaL_ckinteger(L_, s); }
|
||||
double cknumber(LuaSlot s) const { return luaL_cknumber(L_, s); }
|
||||
lua_Integer ckinteger(LuaSlot s) const;
|
||||
lua_Number cknumber(LuaSlot s) const;
|
||||
std::string ckstring(LuaSlot s) const;
|
||||
lua_State *ckthread(LuaSlot s) const { return luaL_ckthread(L_, s); }
|
||||
|
||||
lua_State *ckthread(LuaSlot s) const;
|
||||
|
||||
void clearmetatable(LuaSlot tab) const;
|
||||
void setmetatable(LuaSlot tab, LuaSlot mt) const;
|
||||
void getmetatable(LuaSlot mt, LuaSlot tab) const;
|
||||
|
||||
Reference in New Issue
Block a user