Disable LUA_COMPAT_GFIND and LUA_COMPAT_MOD in Lua 5.2 mode.

This commit is contained in:
Mike Pall 2012-09-19 18:14:00 +02:00
parent 16d8c83743
commit 2d3c1967c7
2 changed files with 2 additions and 2 deletions

View File

@ -209,7 +209,7 @@ LUALIB_API int luaopen_math(lua_State *L)
rs = (RandomState *)lua_newuserdata(L, sizeof(RandomState)); rs = (RandomState *)lua_newuserdata(L, sizeof(RandomState));
rs->valid = 0; /* Use lazy initialization to save some time on startup. */ rs->valid = 0; /* Use lazy initialization to save some time on startup. */
LJ_LIB_REG(L, LUA_MATHLIBNAME, math); LJ_LIB_REG(L, LUA_MATHLIBNAME, math);
#if defined(LUA_COMPAT_MOD) #if defined(LUA_COMPAT_MOD) && !LJ_52
lua_getfield(L, -1, "fmod"); lua_getfield(L, -1, "fmod");
lua_setfield(L, -2, "mod"); lua_setfield(L, -2, "mod");
#endif #endif

View File

@ -857,7 +857,7 @@ LUALIB_API int luaopen_string(lua_State *L)
GCtab *mt; GCtab *mt;
global_State *g; global_State *g;
LJ_LIB_REG(L, LUA_STRLIBNAME, string); LJ_LIB_REG(L, LUA_STRLIBNAME, string);
#if defined(LUA_COMPAT_GFIND) #if defined(LUA_COMPAT_GFIND) && !LJ_52
lua_getfield(L, -1, "gmatch"); lua_getfield(L, -1, "gmatch");
lua_setfield(L, -2, "gfind"); lua_setfield(L, -2, "gfind");
#endif #endif