summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-07-03 08:04:05 (GMT)
committerThomas Heller <theller@ctypes.org>2006-07-03 08:04:05 (GMT)
commit638f7addf39afe167aab84521202a54d1cd42587 (patch)
tree927bd542b0b4423c2a68380438d196658b316ccc /Modules
parentb3c0942356bcf592097f658bdfc2daf6dad7b346 (diff)
downloadcpython-638f7addf39afe167aab84521202a54d1cd42587.zip
cpython-638f7addf39afe167aab84521202a54d1cd42587.tar.gz
cpython-638f7addf39afe167aab84521202a54d1cd42587.tar.bz2
Fixes so that _ctypes can be compiled with the MingW compiler.
It seems that the definition of '__attribute__(x)' was responsible for the compiler ignoring the '__fastcall' attribute on the ffi_closure_SYSV function in libffi_msvc/ffi.c, took me quite some time to figure this out.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/libffi_msvc/fficonfig.h4
-rw-r--r--Modules/_ctypes/libffi_msvc/ffitarget.h6
2 files changed, 4 insertions, 6 deletions
diff --git a/Modules/_ctypes/libffi_msvc/fficonfig.h b/Modules/_ctypes/libffi_msvc/fficonfig.h
index 25b6305..c14f653 100644
--- a/Modules/_ctypes/libffi_msvc/fficonfig.h
+++ b/Modules/_ctypes/libffi_msvc/fficonfig.h
@@ -3,8 +3,10 @@
/* fficonfig.h. Generated automatically by configure. */
/* fficonfig.h.in. Generated automatically from configure.in by autoheader. */
-/* Defines for MSVC */
+/* Define this for MSVC, but not for mingw32! */
+#ifdef _MSC_VER
#define __attribute__(x) /* */
+#endif
#define alloca _alloca
/*----------------------------------------------------------------*/
diff --git a/Modules/_ctypes/libffi_msvc/ffitarget.h b/Modules/_ctypes/libffi_msvc/ffitarget.h
index 57d275b..78c0c37 100644
--- a/Modules/_ctypes/libffi_msvc/ffitarget.h
+++ b/Modules/_ctypes/libffi_msvc/ffitarget.h
@@ -71,11 +71,7 @@ typedef enum ffi_abi {
#define FFI_TRAMPOLINE_SIZE 24
#define FFI_NATIVE_RAW_API 0
#else
-#ifdef _MSC_VER
-# define FFI_TRAMPOLINE_SIZE 15
-#else
-# define FFI_TRAMPOLINE_SIZE 10
-#endif
+#define FFI_TRAMPOLINE_SIZE 15
#define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */
#endif