Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
#include "LuaCompat.h" | ||
|
||
#if LUA_VERSION_NUM >= 502 | ||
//implement missing luaL_typerror function | ||
// Implement missing luaL_typerror function | ||
int luaL_typerror (lua_State *L, int narg, const char *tname) | ||
{ | ||
const char *msg = lua_pushfstring(L, "%s expected, got %s", tname, luaL_typename(L, narg)); | ||
return luaL_argerror(L, narg, msg); | ||
} | ||
|
||
#else | ||
|
||
// Implement function added in lua 5.2 that we now use | ||
void lua_pushglobaltable(lua_State *L) | ||
{ | ||
lua_pushvalue(L, LUA_GLOBALSINDEX); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters