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]

Re: [PATCH] win64 support for libffi (2/2)



On May 18, 2009, at 6:11 AM, Andrew Haley wrote:



Some of your patch seems odd to me, and perhaps changes are needed.


For example, why this change?

@@ -62,41 +71,59 @@
      size_t z;

      /* Align if necessary */
-      if ((sizeof(int) - 1) & (unsigned) argp)
-       argp = (char *) ALIGN(argp, sizeof(int));
+      if ((sizeof(void*) - 1) & (size_t) argp)
+        argp = (char *) ALIGN(argp, sizeof(void*));


sizeof(void*) would probably be more accurately represented by sizeof(ffi_arg), although the effect is the same. win64 is looking for a 64-bit alignment, versus the original 32-bit alignment.
The (size_t) cast should probably be intptr_t.



Or this?

Index: src/x86/win32.S
===================================================================
RCS file: /cvs/libffi/libffi/src/x86/win32.S,v
retrieving revision 1.5
diff -u -b -w -r1.5 win32.S
--- src/x86/win32.S 15 Feb 2008 01:24:06 -0000 1.5
+++ src/x86/win32.S 12 May 2009 13:51:21 -0000
@@ -20,7 +20,7 @@
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS LIABLE FOR
ANY CLAIM, DAMAGES OR



That one's unintentional and probably missed due to scroll blindness.



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