From ffaf74f1477d3182ffc70bcc9913effc44c90ea7 Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 20 Apr 2023 14:41:47 +0200 Subject: fix(build): distinguish vim.mpack from global require'mpack' problem: the api of vim.mpack is not compatible with a system provided mpack solution: don't require 'mpack' directly from the system path --- src/nlua0.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/nlua0.c (limited to 'src/nlua0.c') diff --git a/src/nlua0.c b/src/nlua0.c new file mode 100644 index 0000000000..af811df324 --- /dev/null +++ b/src/nlua0.c @@ -0,0 +1,13 @@ +#include + +#include "mpack/lmpack.h" + +LUA_API int luaopen_nlua0(lua_State* L); + +LUA_API int luaopen_nlua0(lua_State* L) { + lua_getglobal(L, "vim"); + luaopen_mpack(L); + lua_setfield(L, -2, "mpack"); + + return 1; +} -- cgit