diff options
author | Diego Nehab <diego@impa.br> | 2015-02-18 20:51:37 -0200 |
---|---|---|
committer | Diego Nehab <diego@impa.br> | 2015-02-18 20:51:37 -0200 |
commit | ddf429282460323e24652e6beec8e750f8e4a958 (patch) | |
tree | 071ee7879bbd4c917c92e5383c759e98a90cf78e /src/luasocket.c | |
parent | 5edf093643cceb329392aec9606ab3988579b821 (diff) | |
download | luasocket-ddf429282460323e24652e6beec8e750f8e4a958.tar.gz luasocket-ddf429282460323e24652e6beec8e750f8e4a958.tar.bz2 luasocket-ddf429282460323e24652e6beec8e750f8e4a958.zip |
Out of the box support for Lua 5.3.
Diffstat (limited to 'src/luasocket.c')
-rw-r--r-- | src/luasocket.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/luasocket.c b/src/luasocket.c index e6ee747..40731f1 100644 --- a/src/luasocket.c +++ b/src/luasocket.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include "lua.h" | 18 | #include "lua.h" |
19 | #include "lauxlib.h" | 19 | #include "lauxlib.h" |
20 | 20 | ||
21 | |||
22 | /*=========================================================================*\ | 21 | /*=========================================================================*\ |
23 | * LuaSocket includes | 22 | * LuaSocket includes |
24 | \*=========================================================================*/ | 23 | \*=========================================================================*/ |
@@ -32,6 +31,11 @@ | |||
32 | #include "udp.h" | 31 | #include "udp.h" |
33 | #include "select.h" | 32 | #include "select.h" |
34 | 33 | ||
34 | #if LUA_VERSION_NUM > 502 && !defined(LUA_COMPAT_APIINTCASTS) | ||
35 | #define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) | ||
36 | #define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) | ||
37 | #endif | ||
38 | |||
35 | /*-------------------------------------------------------------------------*\ | 39 | /*-------------------------------------------------------------------------*\ |
36 | * Internal function prototypes | 40 | * Internal function prototypes |
37 | \*-------------------------------------------------------------------------*/ | 41 | \*-------------------------------------------------------------------------*/ |
@@ -78,14 +82,6 @@ static int global_unload(lua_State *L) { | |||
78 | return 0; | 82 | return 0; |
79 | } | 83 | } |
80 | 84 | ||
81 | #if LUA_VERSION_NUM > 501 | ||
82 | int luaL_typerror (lua_State *L, int narg, const char *tname) { | ||
83 | const char *msg = lua_pushfstring(L, "%s expected, got %s", | ||
84 | tname, luaL_typename(L, narg)); | ||
85 | return luaL_argerror(L, narg, msg); | ||
86 | } | ||
87 | #endif | ||
88 | |||
89 | /*-------------------------------------------------------------------------*\ | 85 | /*-------------------------------------------------------------------------*\ |
90 | * Setup basic stuff. | 86 | * Setup basic stuff. |
91 | \*-------------------------------------------------------------------------*/ | 87 | \*-------------------------------------------------------------------------*/ |