1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-12-13 10:45:21 +01:00

Backport PUC Lua 5.4's string.{pack,unpack,packsize}

This commit is contained in:
Lars Müller
2025-12-08 23:19:24 +01:00
committed by GitHub
parent 98c6f786f8
commit 6daf3871e7
9 changed files with 568 additions and 0 deletions

View File

@@ -699,6 +699,7 @@ if(BUILD_CLIENT)
${GMP_LIBRARY}
${JSON_LIBRARY}
${LUA_BIT_LIBRARY}
lstrpack
sha256
${FREETYPE_LIBRARY}
${PLATFORM_LIBS}
@@ -789,6 +790,7 @@ if(BUILD_SERVER)
${JSON_LIBRARY}
${LUA_LIBRARY}
${LUA_BIT_LIBRARY}
lstrpack
sha256
${GMP_LIBRARY}
${PLATFORM_LIBS}

View File

@@ -27,6 +27,7 @@ extern "C" {
#else
#include "bit.h"
#endif
#include "lstrpack.h"
}
#include "script/common/c_content.h"
@@ -80,6 +81,9 @@ ScriptApiBase::ScriptApiBase(ScriptingType type):
lua_pushstring(m_luastack, LUA_BITLIBNAME);
lua_call(m_luastack, 1, 0);
// Load string.{pack,unpack,packsize}
setup_lstrpack(m_luastack);
#if BUILD_WITH_TRACY
// Load tracy lua bindings
tracy::LuaRegister(m_luastack);