summaryrefslogtreecommitdiff
path: root/src/compat52.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/compat52.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compat52.h b/src/compat52.h
index 163aecb..9b0a48e 100644
--- a/src/compat52.h
+++ b/src/compat52.h
@@ -29,6 +29,16 @@
29 29
30#define lua_getfield(L, i, f) (lua_getfield(L, (i), (f)), lua_type(L, -1)) 30#define lua_getfield(L, i, f) (lua_getfield(L, (i), (f)), lua_type(L, -1))
31 31
32static int lua_isinteger(lua_State *L, int index) {
33 if (lua_type(L, index) == LUA_TNUMBER) {
34 lua_Number n = lua_tonumber(L, index);
35 lua_Integer i = lua_tointeger(L, index);
36 if (i == n)
37 return 1;
38 }
39 return 0;
40}
41
32#endif 42#endif
33 43
34#if LUA_VERSION_NUM < 502 44#if LUA_VERSION_NUM < 502