Forráskód Böngészése

Disable LUA_COMPAT_GFIND and LUA_COMPAT_MOD in Lua 5.2 mode.

Mike Pall 13 éve
szülő
commit
2d3c1967c7
2 módosított fájl, 2 hozzáadás és 2 törlés
  1. 1 1
      src/lib_math.c
  2. 1 1
      src/lib_string.c

+ 1 - 1
src/lib_math.c

@@ -209,7 +209,7 @@ LUALIB_API int luaopen_math(lua_State *L)
   rs = (RandomState *)lua_newuserdata(L, sizeof(RandomState));
   rs->valid = 0;  /* Use lazy initialization to save some time on startup. */
   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_setfield(L, -2, "mod");
 #endif

+ 1 - 1
src/lib_string.c

@@ -857,7 +857,7 @@ LUALIB_API int luaopen_string(lua_State *L)
   GCtab *mt;
   global_State *g;
   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_setfield(L, -2, "gfind");
 #endif