return a;
}
+LIBTEST_API float STDCALL
+mono_test_marshal_pass_return_float (float f) {
+ return f + 1.0;
+}
+
struct ss
{
int i;
return delegate (2);
}
+static int STDCALL inc_cb (int i)
+{
+ return i + 1;
+}
+
+LIBTEST_API int STDCALL
+mono_test_marshal_out_delegate (SimpleDelegate *delegate)
+{
+ *delegate = inc_cb;
+
+ return 0;
+}
+
LIBTEST_API SimpleDelegate STDCALL
mono_test_marshal_return_delegate (SimpleDelegate delegate)
{
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)
{
{
HandleRef ref;
+ memset (&ref, 0, sizeof (ref));
+
return ref;
}
* 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)
/* Searches for mono symbols in all loaded modules */
static gpointer
-lookup_mono_symbol (char *symbol_name)
+lookup_mono_symbol (const char *symbol_name)
{
gpointer symbol;
if (g_module_symbol (g_module_open (NULL, G_MODULE_BIND_LAZY), symbol_name, &symbol))
gpointer (*mono_method_get_unmanaged_thunk)(gpointer)
= lookup_mono_symbol ("mono_method_get_unmanaged_thunk");
- gpointer (*mono_string_new_wrapper)(char *)
+ gpointer (*mono_string_new_wrapper)(const char *)
= lookup_mono_symbol ("mono_string_new_wrapper");
char* (*mono_string_to_utf8)(gpointer)
}
LIBTEST_API winx64_struct1 STDCALL
-mono_test_Winx64_struct1_ret ()
+mono_test_Winx64_struct1_ret (void)
{
winx64_struct1 ret;
ret.a = 123;
}
LIBTEST_API winx64_struct2 STDCALL
-mono_test_Winx64_struct2_ret ()
+mono_test_Winx64_struct2_ret (void)
{
winx64_struct2 ret;
ret.a = 4;
}
LIBTEST_API winx64_struct3 STDCALL
-mono_test_Winx64_struct3_ret ()
+mono_test_Winx64_struct3_ret (void)
{
winx64_struct3 ret;
ret.a = 4;
}
LIBTEST_API winx64_struct4 STDCALL
-mono_test_Winx64_struct4_ret ()
+mono_test_Winx64_struct4_ret (void)
{
winx64_struct4 ret;
ret.a = 4;
}
LIBTEST_API winx64_struct5 STDCALL
-mono_test_Winx64_struct5_ret ()
+mono_test_Winx64_struct5_ret (void)
{
winx64_struct5 ret;
ret.a = 4;
return func (a, b, c, d, e, f);
}
-typedef winx64_struct1 (STDCALL *managed_struct1_ret_delegate) ();
+typedef winx64_struct1 (STDCALL *managed_struct1_ret_delegate) (void);
LIBTEST_API int STDCALL
mono_test_Winx64_struct1_ret_managed (managed_struct1_ret_delegate func)
return 0;
}
-typedef winx64_struct5 (STDCALL *managed_struct5_ret_delegate) ();
+typedef winx64_struct5 (STDCALL *managed_struct5_ret_delegate) (void);
LIBTEST_API int STDCALL
mono_test_Winx64_struct5_ret_managed (managed_struct5_ret_delegate func)