]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Remove Lua 5.0 compatibility defines.
authorMike Pall <mike>
Fri, 17 Mar 2017 11:07:21 +0000 (12:07 +0100)
committerMike Pall <mike>
Fri, 17 Mar 2017 11:07:21 +0000 (12:07 +0100)
Suggested by François Perrad.

src/lib_math.c
src/lib_string.c
src/luaconf.h

index 7bb03880bd7ff660f0dfaaa77eaef1ebc4b1f31a..ef9dda2da66316654bd78d8ed4e2861eb0e076b0 100644 (file)
@@ -221,10 +221,6 @@ 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) && !LJ_52
-  lua_getfield(L, -1, "fmod");
-  lua_setfield(L, -2, "mod");
-#endif
   return 1;
 }
 
index c7f37bc75247fe869fbe03e736d19534eceba67e..76b0730aca34b813466526ece19a5cb4575e3fb2 100644 (file)
@@ -737,10 +737,6 @@ 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) && !LJ_52
-  lua_getfield(L, -1, "gmatch");
-  lua_setfield(L, -2, "gfind");
-#endif
   mt = lj_tab_new(L, 0, 1);
   /* NOBARRIER: basemt is a GC root. */
   g = G(L);
index 87b052dba008888f1834f3e3f501fe6d950981f9..6486c0039809e1cda5b07065b7d3185c12b355ee 100644 (file)
 #define LUAI_GCMUL     200     /* Run GC at 200% of allocation speed. */
 #define LUA_MAXCAPTURES        32      /* Max. pattern captures. */
 
-/* Compatibility with older library function names. */
-#define LUA_COMPAT_MOD         /* OLD: math.mod, NEW: math.fmod */
-#define LUA_COMPAT_GFIND       /* OLD: string.gfind, NEW: string.gmatch */
-
 /* Configuration for the frontend (the luajit executable). */
 #if defined(luajit_c)
 #define LUA_PROGNAME   "luajit"  /* Fallback frontend name. */