mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
lua move constants out of binary image
Rockbox constants are auto generated by a perl script like the majority of the plugin functions. Constants are contained in rb_defines.lua, if the file exists it is auto loaded by the lua state for backwards compatibility Frees ~1k Change-Id: I237700576c748f468249e501c839d89effca3f39
This commit is contained in:
parent
47639fb9ac
commit
c9aeb4284e
4 changed files with 215 additions and 7 deletions
|
@ -793,7 +793,11 @@ LUALIB_API int luaopen_rock(lua_State *L)
|
|||
{
|
||||
luaL_register(L, LUA_ROCKLIBNAME, rocklib);
|
||||
luaL_register(L, LUA_ROCKLIBNAME, rocklib_aux);
|
||||
|
||||
lua_getglobal(L, "require");
|
||||
lua_pushstring(L, "rb_defines");
|
||||
if (lua_pcall (L, 1, 0, 0))
|
||||
lua_pop(L, 1);
|
||||
#if 0
|
||||
static const struct lua_int_reg rlib_const_int[] =
|
||||
{
|
||||
/* useful integer constants */
|
||||
|
@ -860,7 +864,7 @@ LUALIB_API int luaopen_rock(lua_State *L)
|
|||
luaS_newlloc(L, rlcs->name, TSTR_INBIN);
|
||||
lua_setfield(L, -2, rlcs->name);
|
||||
}
|
||||
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue