diff options
author | chai <chaifix@163.com> | 2018-09-09 18:16:07 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-09-09 18:16:07 +0800 |
commit | 1b5b88f2606c1e587b08228890208d9996cdbabf (patch) | |
tree | e48ad6fa360519b82ad041b1e53b0669db668e82 /src/lua/libraries | |
parent | e3ddc74a36e4336d28e9e09586b5194c2e6e6dc6 (diff) |
*update
Diffstat (limited to 'src/lua/libraries')
-rw-r--r-- | src/lua/libraries/luax/luax.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lua/libraries/luax/luax.h b/src/lua/libraries/luax/luax.h index b6b3e80..1c83912 100644 --- a/src/lua/libraries/luax/luax.h +++ b/src/lua/libraries/luax/luax.h @@ -401,6 +401,20 @@ inline void luax_setfieldstrings(lua_State* L, const luax_Str* strs) } } +typedef struct luax_Num +{ + const char* name; + float number; +}; + +inline void luax_setfieldnumbers(lua_State* L, const luax_Num* strs) +{ + for (int i = 0; strs[i].name != 0; ++i) + { + luax_setfieldnumber(L, strs[i].name, strs[i].number); + } +} + typedef luaL_Reg luax_Ref; #endif // #if LUA_VERSION_NUM == 501 |