diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 14 |
1 files changed, 6 insertions, 8 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.81 2009/06/17 18:38:54 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.82 2009/06/18 16:36:40 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -129,13 +129,11 @@ LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { | |||
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | 131 | ||
| 132 | LUA_API void lua_checkversion_ (lua_State *L, int version) { | 132 | static const lua_Number l_version = LUA_VERSION_NUM; |
| 133 | lua_lock(L); | 133 | |
| 134 | if (version != LUA_VERSION_NUM) | 134 | LUA_API const lua_Number *lua_version (lua_State *L) { |
| 135 | luaG_runerror(L, "app./library not compiled with header " LUA_VERSION); | 135 | if (L == NULL) return &l_version; |
| 136 | if (G(L)->nilobjp != luaO_nilobject) | 136 | else return G(L)->version; |
| 137 | luaG_runerror(L, "application using multiple Lua VMs"); | ||
| 138 | lua_unlock(L); | ||
| 139 | } | 137 | } |
| 140 | 138 | ||
| 141 | 139 | ||
