+2003-10-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/libtest.c (mono_test_marshal_delegate): Added test for
+ stdcall calling convention.
+
2003-10-09 Dick Porter <dick@ximian.com>
* acconfig.h:
};
struct sc5 mono_return_sc5 (struct sc5 a) {
- printf ("Got values %d %d %d\n", a.c[0], a.c[1], a.c[2], a.c[3], a.c[4]);
+ printf ("Got values %d %d %d %d %d\n", a.c[0], a.c[1], a.c[2], a.c[3], a.c[4]);
a.c[0]++;
a.c[1] += 2;
a.c[2] += 3;
return 1;
}
+int
+mono_test_empty_pinvoke (int i)
+{
+ return i;
+}
+
+int
+mono_test_marshal_bool_byref (int a, char *b, int c)
+{
+ int res = *b;
+
+ *b = 1;
+
+ return res;
+}
+
int
mono_test_marshal_array (int *a1)
{
return 0;
}
+#ifdef WIN32
+typedef int (__stdcall *SimpleDelegate) (int a);
+#else
typedef int (*SimpleDelegate) (int a);
+#endif
+
+static void *
+get_sp (void)
+{
+ int i;
+ void *p;
+
+ p = &i;
+ return p;
+}
int
mono_test_marshal_delegate (SimpleDelegate delegate)
{
+ void *sp1, *sp2;
+
+ /* Check that the delegate wrapper is stdcall */
+ delegate (2);
+ sp1 = get_sp ();
+ delegate (2);
+ sp2 = get_sp ();
+ g_assert (sp1 == sp2);
+
return delegate (2);
}