diff options
| -rw-r--r-- | lbaselib.c | 14 |
1 files changed, 13 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbaselib.c,v 1.236 2010/03/12 19:14:06 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.237 2010/03/13 03:57:46 roberto Exp roberto $ |
| 3 | ** Basic library | 3 | ** Basic library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -252,6 +252,8 @@ static int luaB_pairs (lua_State *L) { | |||
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | 254 | ||
| 255 | #if defined(LUA_COMPAT_IPAIRS) | ||
| 256 | |||
| 255 | static int ipairsaux (lua_State *L) { | 257 | static int ipairsaux (lua_State *L) { |
| 256 | int i = luaL_checkint(L, 2); | 258 | int i = luaL_checkint(L, 2); |
| 257 | luaL_checktype(L, 1, LUA_TTABLE); | 259 | luaL_checktype(L, 1, LUA_TTABLE); |
| @@ -266,6 +268,16 @@ static int luaB_ipairs (lua_State *L) { | |||
| 266 | return pairsmeta(L, "__ipairs", 1); | 268 | return pairsmeta(L, "__ipairs", 1); |
| 267 | } | 269 | } |
| 268 | 270 | ||
| 271 | #else | ||
| 272 | |||
| 273 | #define ipairsaux luaB_ipairs | ||
| 274 | |||
| 275 | static int luaB_ipairs (lua_State *L) { | ||
| 276 | return luaL_error(L, "'ipairs' deprecated"); | ||
| 277 | } | ||
| 278 | |||
| 279 | #endif | ||
| 280 | |||
| 269 | 281 | ||
| 270 | static int load_aux (lua_State *L, int status) { | 282 | static int load_aux (lua_State *L, int status) { |
| 271 | if (status == LUA_OK) | 283 | if (status == LUA_OK) |
