-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
python/cpython#9258 changed callproc to use functions from the internal libffi which we don't use. Just copy the functions into callproc directly instead.
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
mingw-w64-python3/1900-ctypes-dont-depend-on-internal-libffi.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- Python-3.7.1/Modules/_ctypes/callproc.c.orig 2018-10-21 20:21:21.305822500 +0200 | ||
+++ Python-3.7.1/Modules/_ctypes/callproc.c 2018-10-21 20:51:03.252890200 +0200 | ||
@@ -701,6 +701,21 @@ | ||
} | ||
} | ||
|
||
+#ifdef __MINGW32__ | ||
+/* | ||
+Per: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx | ||
+To be returned by value in RAX, user-defined types must have a length | ||
+of 1, 2, 4, 8, 16, 32, or 64 bits | ||
+*/ | ||
+static int can_return_struct_as_int(size_t s) | ||
+{ | ||
+ return s == 1 || s == 2 || s == 4; | ||
+} | ||
+static int can_return_struct_as_sint64(size_t s) | ||
+{ | ||
+ return s == 8; | ||
+} | ||
+#endif | ||
|
||
ffi_type *_ctypes_get_ffi_type(PyObject *obj) | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters