diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-19 11:21:57 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-19 11:21:57 -0300 |
commit | 47c562435bd82b5ac5b8574fe80d2ff2ff8f9452 (patch) | |
tree | 741edd90ff5c179b3da4bdac4533918edf9421b0 | |
parent | 02504d86d308aa3209f2faecc804912e3115b985 (diff) | |
download | lua-47c562435bd82b5ac5b8574fe80d2ff2ff8f9452.tar.gz lua-47c562435bd82b5ac5b8574fe80d2ff2ff8f9452.tar.bz2 lua-47c562435bd82b5ac5b8574fe80d2ff2ff8f9452.zip |
better error messages for luaL_checkversion
-rw-r--r-- | lauxlib.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.186 2009/04/02 19:54:06 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.187 2009/06/18 18:59:58 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 | */ |
@@ -744,8 +744,9 @@ LUALIB_API lua_State *luaL_newstate (void) { | |||
744 | LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) { | 744 | LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) { |
745 | const lua_Number *v = lua_version(L); | 745 | const lua_Number *v = lua_version(L); |
746 | if (v != lua_version(NULL)) | 746 | if (v != lua_version(NULL)) |
747 | luaL_error(L, "application using two incompatible Lua VMs"); | 747 | luaL_error(L, "multiple Lua VMs detected"); |
748 | else if (*v != ver) | 748 | else if (*v != ver) |
749 | luaL_error(L, "application and Lua core using different Lua versions" | 749 | luaL_error(L, "version mismatch: app. needs %d, Lua core provides %f", |
750 | "(%d x %d)", (int)*v, (int)ver); | 750 | ver, *v); |
751 | } | 751 | } |
752 | |||