public static IntPtr ToFunctionPointer(this LuaWarnFunction d) { if (d == null) { return(IntPtr.Zero); } return(Marshal.GetFunctionPointerForDelegate <LuaWarnFunction>(d)); }
public static IntPtr ToFunctionPointer(this LuaWarnFunction d) { if (d == null) { return(IntPtr.Zero); } #if NETFRAMEWORK return(Marshal.GetFunctionPointerForDelegate(d)); #else return(Marshal.GetFunctionPointerForDelegate <LuaWarnFunction>(d)); #endif }
public void TestWarning() { using (var lua = new Lua()) { LuaWarnFunction warnFunction = MyWarning; var sb = new StringBuilder(); lua.PushObject(sb); lua.SetWarningFunction(warnFunction, lua.Handle); lua.Warning("Ola um dois tres", false); Assert.AreEqual("Ola um dois tres", sb.ToString(), "#1"); } }