diff options
| -rw-r--r-- | lbitlib.c | 12 |
1 files changed, 2 insertions, 10 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbitlib.c,v 1.23 2014/02/26 12:38:18 roberto Exp roberto $ | 2 | ** $Id: lbitlib.c,v 1.24 2014/03/18 18:27:08 roberto Exp roberto $ |
| 3 | ** Standard library for bitwise operations | 3 | ** Standard library for bitwise operations |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -219,17 +219,9 @@ LUAMOD_API int luaopen_bit32 (lua_State *L) { | |||
| 219 | 219 | ||
| 220 | #else /* }{ */ | 220 | #else /* }{ */ |
| 221 | 221 | ||
| 222 | static int b_err (lua_State *L) { | ||
| 223 | return luaL_error(L, "library 'bit32' is deprecated"); | ||
| 224 | } | ||
| 225 | |||
| 226 | 222 | ||
| 227 | LUAMOD_API int luaopen_bit32 (lua_State *L) { | 223 | LUAMOD_API int luaopen_bit32 (lua_State *L) { |
| 228 | lua_createtable(L, 0, 1); /* new table to represent the module */ | 224 | lua_pushnil(L); |
| 229 | lua_pushvalue(L, -1); | ||
| 230 | lua_setmetatable(L, -2); /* set it as its own metatable */ | ||
| 231 | lua_pushcfunction(L, b_err); | ||
| 232 | lua_setfield(L, -2, "__index"); /* metatable.__index = b_errret */ | ||
| 233 | return 1; | 225 | return 1; |
| 234 | } | 226 | } |
| 235 | 227 | ||
