lua

A copy of the Lua development repository
Log | Files | Refs | README

commit a73da6112d4c6f20abf634cb68f89fe31fb9037c
parent 6a5d87771fa28c8337c5e10f4a0c4364dbeb37e9
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Thu, 15 May 2014 16:28:09 -0300

deprecated library throws an error if called (instead of silently
not loading itself)

Diffstat:
Mlbitlib.c | 5++---
Mlinit.c | 8+++++---
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lbitlib.c b/lbitlib.c @@ -1,5 +1,5 @@ /* -** $Id: lbitlib.c,v 1.24 2014/03/18 18:27:08 roberto Exp roberto $ +** $Id: lbitlib.c,v 1.25 2014/03/20 19:22:16 roberto Exp roberto $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ @@ -221,8 +221,7 @@ LUAMOD_API int luaopen_bit32 (lua_State *L) { LUAMOD_API int luaopen_bit32 (lua_State *L) { - lua_pushnil(L); - return 1; + return luaL_error(L, "library 'bit32' has been deprecated"); } #endif /* } */ diff --git a/linit.c b/linit.c @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.32 2011/04/08 19:17:36 roberto Exp roberto $ +** $Id: linit.c,v 1.33 2014/02/06 17:32:33 roberto Exp roberto $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ @@ -34,10 +34,12 @@ static const luaL_Reg loadedlibs[] = { {LUA_IOLIBNAME, luaopen_io}, {LUA_OSLIBNAME, luaopen_os}, {LUA_STRLIBNAME, luaopen_string}, - {LUA_UTF8LIBNAME, luaopen_utf8}, - {LUA_BITLIBNAME, luaopen_bit32}, {LUA_MATHLIBNAME, luaopen_math}, {LUA_DBLIBNAME, luaopen_debug}, + {LUA_UTF8LIBNAME, luaopen_utf8}, +#if defined(LUA_COMPAT_BITLIB) + {LUA_BITLIBNAME, luaopen_bit32}, +#endif {NULL, NULL} };