Bläddra i källkod

Use 'luaL_newmetatable' for 'setMetatable'

Ole 9 år sedan
förälder
incheckning
9deb7e9e7b
1 ändrade filer med 1 tillägg och 5 borttagningar
  1. 1 5
      lib/luwra/auxiliary.hpp

+ 1 - 5
lib/luwra/auxiliary.hpp

@@ -37,12 +37,8 @@ bool equal(State* state, int index1, int index2) {
  */
 static inline
 void setMetatable(State* state, const char* name) {
-#if LUA_VERSION_NUM <= 501
-	luaL_getmetatable(state, name);
+	luaL_newmetatable(state, name);
 	lua_setmetatable(state, -2);
-#else
-	luaL_setmetatable(state, name);
-#endif
 }
 
 /**