This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch libffi]: Add support for ffi_prep_raw_closure_loc for X86_WIN32 for fixing finally PR 51500


Hi,

ChangeLog

2012-02-10  Kai Tietz  <ktietz@redhat.com>

	* src/x86/ffi.c (ffi_prep_raw_closure_loc): Add thiscall
	support for X86_WIN32.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and x86_64-unknown-linux-gnu.

Ok for apply?

Regards,
Kai

Index: src/x86/ffi.c
===================================================================
--- src/x86/ffi.c	(revision 184105)
+++ src/x86/ffi.c	(working copy)
@@ -720,6 +720,9 @@
   int i;

   if (cif->abi != FFI_SYSV) {
+#ifdef X86_WIN32
+    if (cif->abi != FFI_THISCALL)
+#endif
     return FFI_BAD_ABI;
   }

@@ -734,10 +737,20 @@
       FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE);
     }

-
+#if X86_WIN32
+  if (cif->abi == FFI_SYSV)
+    {
+#endif
   FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV,
                        codeloc);
-
+#if X86_WIN32
+    }
+  else if (cif->abi == FFI_THISCALL)
+    {
+      FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], &ffi_closure_raw_SYSV,
+				    codeloc, cif->bytes);
+    }
+#endif
   closure->cif  = cif;
   closure->user_data = user_data;
   closure->fun  = fun;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]