8 |
8 |
9 #if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501) |
9 #if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501) |
10 #include <compat-5.1.h> |
10 #include <compat-5.1.h> |
11 #endif |
11 #endif |
12 |
12 |
13 |
13 /* |
|
14 * |
|
15 * Table construction helper functions |
|
16 * |
|
17 * LUA_PUSH_ATTRIB_* creates string indexed (hashmap) |
|
18 * LUA_PUSH_ATTRIB_* creates integer indexed (array) |
|
19 * |
|
20 */ |
14 |
21 |
15 #define LUA_PUSH_ATTRIB_INT(n, v) \ |
22 #define LUA_PUSH_ATTRIB_INT(n, v) \ |
16 lua_pushstring(L, n); \ |
23 lua_pushstring(L, n); \ |
17 lua_pushinteger(L, v); \ |
24 lua_pushinteger(L, v); \ |
18 lua_rawset(L, -3); |
25 lua_rawset(L, -3); |