forked from mdombroski/libui-lua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlua-compat.h
More file actions
29 lines (22 loc) · 699 Bytes
/
lua-compat.h
File metadata and controls
29 lines (22 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef LUA_COMPAT_H
#define LUA_COMPAT_H
#include <lua.h>
#include <lauxlib.h>
// implementing support for old Lua versions
#if LUA_VERSION_NUM < 501
#error Lua < 5.1 not supported
#endif
// Functions not available in Lua < 5.3
#if LUA_VERSION_NUM < 503
int lua_isinteger( lua_State* L, int idx );
void lua_rotate( lua_State* L, int idx, int n );
#endif
// Functions not available in Lua < 5.2
#if LUA_VERSION_NUM < 502
int lua_absindex( lua_State *L, int i );
void lua_len( lua_State* L, int i );
void luaL_setfuncs( lua_State* L, luaL_Reg* l, int nup );
#define luaL_newlib(L,l) \
(lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1), luaL_setfuncs(L,l,0))
#endif
#endif // LUA_COMPAT_H