2 using System.Runtime.InteropServices;
6 [StructLayout (LayoutKind.Sequential)]
7 public struct SimpleStruct {
14 public static int delegate_test (SimpleStruct ss)
16 Console.WriteLine ("delegate called");
17 Console.WriteLine ("A: " + ss.a);
18 Console.WriteLine ("B: " + ss.b);
19 Console.WriteLine ("C: " + ss.c);
20 Console.WriteLine ("D: " + ss.d);
22 if (!ss.a && ss.b && !ss.c && ss.d == "TEST")
28 [DllImport ("libtest.so", EntryPoint="mono_test_marshal_delegate2")]
29 public static extern int mono_test_marshal_delegate2 (SimpleDelegate2 d);
31 public delegate int SimpleDelegate2 (SimpleStruct ss);
33 public static int Main () {
35 SimpleDelegate2 d = new SimpleDelegate2 (delegate_test);
37 if (mono_test_marshal_delegate2 (d) != 0)