Replace call to luaL_typerror with a custom error message

The function luaL_typerror was removed from public API in Lua 5.2. This
commit replaces it with calls to luaL_argerror and a custom error
message.
This commit is contained in:
Alexandre Erwin Ittner 2010-11-16 23:45:44 -02:00
parent fc22d5b632
commit e394f70df0

View File

@ -81,7 +81,8 @@ static iconv_t get_iconv_t(lua_State *L, int i) {
luaL_error(L, "attempt to use an invalid " ICONV_TYPENAME);
return cd;
}
luaL_typerror(L, i, ICONV_TYPENAME);
luaL_argerror(L, i, lua_pushfstring(L, ICONV_TYPENAME " expected, got %s",
luaL_typename(L, i)));
return NULL;
}