diff options
| -rw-r--r-- | lauxlib.c | 9 |
1 files changed, 8 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.c,v 1.222 2010/10/25 19:01:37 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.223 2010/10/25 20:31:11 roberto Exp roberto $ |
| 3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -876,5 +876,12 @@ LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) { | |||
| 876 | else if (*v != ver) | 876 | else if (*v != ver) |
| 877 | luaL_error(L, "version mismatch: app. needs %d, Lua core provides %f", | 877 | luaL_error(L, "version mismatch: app. needs %d, Lua core provides %f", |
| 878 | ver, *v); | 878 | ver, *v); |
| 879 | /* check conversions number -> integer types */ | ||
| 880 | lua_pushnumber(L, -(lua_Number)0x1234); | ||
| 881 | if (lua_tointeger(L, -1) != -0x1234 || | ||
| 882 | lua_tounsigned(L, -1) != (lua_Unsigned)-0x1234) | ||
| 883 | luaL_error(L, "bad conversion number->int;" | ||
| 884 | " must recompile Lua with proper settings"); | ||
| 885 | lua_pop(L, 1); | ||
| 879 | } | 886 | } |
| 880 | 887 | ||
