2008-12-05 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / tests / libtest.c
index f3cd623b5c8ff0c11d468188e796bca6d6db269f..3fd22de9edde942c1d9d51839c98f71c2d12295d 100644 (file)
@@ -2072,6 +2072,28 @@ mono_test_marshal_return_string_array_delegate (ReturnStringArrayDelegate d)
        return res;
 }
 
+typedef int (STDCALL *ByrefStringDelegate) (char **s);
+
+LIBTEST_API int STDCALL 
+mono_test_marshal_byref_string_delegate (ByrefStringDelegate d)
+{
+       char *s = (char*)"ABC";
+       int res;
+
+       res = d (&s);
+       if (res != 0)
+               return res;
+
+       if (!strcmp (s, "DEF"))
+               res = 0;
+       else
+               res = 2;
+
+       marshal_free (s);
+
+       return res;
+}
+
 LIBTEST_API int STDCALL 
 add_delegate (int i, int j)
 {
@@ -2956,7 +2978,7 @@ mono_test_marshal_ccw_itest (MonoComObject *pUnk)
  * mono_method_get_unmanaged_thunk tests
  */
 
-#if defined(__GNUC__) && defined(__i386__) && (defined(__linux__) || defined (__APPLE__))
+#if defined(__GNUC__) && ((defined(__i386__) && (defined(__linux__) || defined (__APPLE__))) || (defined(__ppc__) && defined(__APPLE__)))
 #define ALIGN(size) __attribute__ ((aligned(size)))
 #else
 #define ALIGN(size)