mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-11-08 14:28:21 +01:00
This is a replacement for luaL_typerror , removed from Lua 5.2, which corrects the spelling.
NOTE: There is one failing test in.the /test/testsrvr.lua and /test/testclnt.lua combination which was present in the repo I cloned from.
This commit is contained in:
parent
e15ed19db6
commit
c8eed36788
10
src/lua_typeerror.c
Normal file
10
src/lua_typeerror.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include "lua_typeerror.h"
|
||||
#include "lua.h"
|
||||
#include "lauxlib.h"
|
||||
|
||||
int luaL_typeerror (lua_State *L, int narg, const char *tname)
|
||||
{
|
||||
const char *msg = lua_pushfstring(L, "%s expected, got %s",tname, luaL_typename(L, narg));
|
||||
return luaL_argerror(L, narg, msg);
|
||||
}
|
||||
|
7
src/lua_typeerror.h
Normal file
7
src/lua_typeerror.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef LUA_TYPEERROR_H_
|
||||
#define LUA_TYPEERROR_H_
|
||||
|
||||
struct lua_State;
|
||||
int luaL_typeerror (struct lua_State *L, int narg, const char *tname);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user