2010-05-31 Robert Jordan <robertj@gmx.net>
authorRobert Jordan <robertj@gmx.net>
Mon, 31 May 2010 00:01:53 +0000 (00:01 -0000)
committerRobert Jordan <robertj@gmx.net>
Mon, 31 May 2010 00:01:53 +0000 (00:01 -0000)
* pinvoke2.cs (test_0_calli_dynamic): Use the cdecl version
of mono_test_marshal_inout_array. Fixes the test when compiled
with MSC (and GCC where it worked by accident).

* libtest.c (mono_test_marshal_inout_array_cdecl):
New. cdecl wrapper for the function with the same name.

svn path=/trunk/mono/; revision=158175

mono/tests/ChangeLog
mono/tests/libtest.c
mono/tests/pinvoke2.cs

index 5dcfc03c36bde091320783bad67d1a590b6b6e27..8324af2c447656194af7783d1dfe5e53d9d6bae0 100644 (file)
@@ -1,3 +1,12 @@
+2010-05-31  Robert Jordan  <robertj@gmx.net>
+
+       * pinvoke2.cs (test_0_calli_dynamic): Use the cdecl version
+       of mono_test_marshal_inout_array. Fixes the test when compiled
+       with MSC (and GCC where it worked by accident).
+
+       * libtest.c (mono_test_marshal_inout_array_cdecl):
+       New. cdecl wrapper for the function with the same name.
+
 2010-05-31  Robert Jordan  <robertj@gmx.net>
 
        * libtest.c (mono_test_marshal_lookup_symbol): Export as STDCALL because
index bfb8c9ed4da47b7766e22599fbbae9dc147a2727..413b908dc9ac408ad576971b0fbf6ececfb61062 100644 (file)
@@ -419,6 +419,12 @@ mono_test_marshal_inout_array (int *a1)
        return sum;
 }
 
+LIBTEST_API int /* cdecl */
+mono_test_marshal_inout_array_cdecl (int *a1)
+{
+       return mono_test_marshal_inout_array (a1);
+}
+
 LIBTEST_API int STDCALL  
 mono_test_marshal_out_array (int *a1)
 {
index a5c66d755fbf9d17643a67bec7ad2877c0d3b248..e2d486b4730f1903f1b8ee13eeea3cab9a0d373d 100644 (file)
@@ -1566,7 +1566,8 @@ public class Tests {
        delegate void CalliDel (IntPtr a, int[] f);
 
        public static int test_0_calli_dynamic () {
-               IntPtr func = mono_test_marshal_lookup_symbol ("mono_test_marshal_inout_array");
+               /* we need the cdecl version because the icall convention demands it under Windows */
+               IntPtr func = mono_test_marshal_lookup_symbol ("mono_test_marshal_inout_array_cdecl");
 
                DynamicMethod dm = new DynamicMethod ("calli", typeof (void), new Type [] { typeof (IntPtr), typeof (int[]) });