diff --git a/src/Lua51.cs b/src/Lua51.cs index dd3b9f0..fb8c421 100644 --- a/src/Lua51.cs +++ b/src/Lua51.cs @@ -602,10 +602,10 @@ public static void luaL_setn(lua_State L, int i, int j) public const int LUA_ERRFILE = LUA_ERRERR + 1; [DllImport(DllName, CallingConvention = Convention)] - public static extern void luaL_openlib(lua_State L, string libname, luaL_Reg l, int nup); + public static extern void luaL_openlib(lua_State L, string libname, luaL_Reg[] l, int nup); [DllImport(DllName, CallingConvention = Convention)] - public static extern void luaL_register(lua_State L, string libname, luaL_Reg l); + public static extern void luaL_register(lua_State L, string libname, luaL_Reg[] l); [DllImport(DllName, CallingConvention = Convention)] public static extern int luaL_getmetafield(lua_State L, int obj, string e); diff --git a/src/LuaJIT.cs b/src/LuaJIT.cs index 29fd333..e64e825 100644 --- a/src/LuaJIT.cs +++ b/src/LuaJIT.cs @@ -66,7 +66,7 @@ public struct luaL_Buffer { public delegate nuint lua_Alloc(nuint ud, nuint ptr, size_t osize, size_t nsize); public delegate void lua_Hook(lua_State L, lua_Debug ar); - public static unsafe luaL_Reg AsLuaLReg(string name, delegate*unmanaged func) => new() { name = name, func = (nint) func }; + public static unsafe luaL_Reg AsLuaLReg(string name, delegate*unmanaged func) => new() { name = name, func = (nint) func }; public const string LUAJIT_VERSION = "LuaJIT 2.1.0-beta3"; public const int LUAJIT_VERSION_NUM = 20100; @@ -562,10 +562,10 @@ public static int lua_getgccount(lua_State L) public const int LUA_MASKCOUNT = 1 << LUA_HOOKCOUNT; [DllImport(DllName, CallingConvention = Convention)] - public static extern int lua_getstack(lua_State L, int level, lua_Debug ar); + public static extern int lua_getstack(lua_State L, int level, ref lua_Debug ar); [DllImport(DllName, CallingConvention = Convention)] - public static extern int lua_getinfo(lua_State L, string what, lua_Debug ar); + public static extern int lua_getinfo(lua_State L, string what, ref lua_Debug ar); [DllImport(DllName, CallingConvention = Convention, EntryPoint = "lua_getlocal")] private static extern nint _lua_getlocal(lua_State L, lua_Debug ar, int n); @@ -657,10 +657,10 @@ public static double lua_version(lua_State L) public const int LUA_ERRFILE = LUA_ERRERR + 1; [DllImport(DllName, CallingConvention = Convention)] - public static extern void luaL_openlib(lua_State L, string libname, luaL_Reg l, int nup); - + public static extern void luaL_openlib(lua_State L, string libname, luaL_Reg[] l, int nup); + [DllImport(DllName, CallingConvention = Convention)] - public static extern void luaL_register(lua_State L, string libname, luaL_Reg l); + public static extern void luaL_register(lua_State L, string libname, luaL_Reg[] l); [DllImport(DllName, CallingConvention = Convention)] public static extern int luaL_getmetafield(lua_State L, int obj, string e);