Thomas Heller
861acee048
Fix for foreign functions returning small structures on 64-bit big
...
endian machines. Should fix the remaininf failure in the PPC64
Debian buildbot.
Thanks to Matthias Klose for providing access to a machine to debug
and test this.
2006-06-07 20:43:06 +00:00
Thomas Heller
b1998bc860
Use the same big-endian hack as in _ctypes/callproc.c for callback functions.
...
This fixes the callback function tests that return float.
2006-06-06 19:25:13 +00:00
Thomas Heller
d8714dedfa
Add a hack so that foreign functions returning float now do work on 64-bit
...
big endian platforms.
2006-06-06 18:50:46 +00:00
Thomas Heller
07347d6efc
Damn - the sentinel was missing. And fix another silly mistake.
2006-06-06 11:54:32 +00:00
Thomas Heller
ecc3e67b98
Convert CFieldObject tp_members to tp_getset, since there is no
...
structmember typecode for Py_ssize_t fields. This should fix some of
the errors on the PPC64 debian machine (64-bit, big endian).
Assigning to readonly fields now raises AttributeError instead of
TypeError, so the testcase has to be changed as well.
2006-06-06 11:34:33 +00:00
Thomas Heller
bd16bce81f
PyTuple_Pack is not available in Python 2.3, but ctypes must stay
...
compatible with that.
2006-05-31 11:37:58 +00:00
Georg Brandl
7784f12d74
Replace Py_BuildValue("OO") by PyTuple_Pack.
2006-05-26 20:04:44 +00:00
Bob Ippolito
ad647859f4
Fix distutils so that libffi will cross-compile between darwin/x86 and darwin/ppc
2006-05-26 14:07:23 +00:00
Bob Ippolito
45c6472f99
Add missing files from x86 darwin ctypes patch
2006-05-25 21:58:05 +00:00
Ronald Oussoren
f5bc414334
Fix minor typo in prep_cif.c
2006-05-25 21:30:54 +00:00
Bob Ippolito
66c0935d67
enable darwin/x86 support for libffi and hence ctypes (doesn't yet support --enable-universalsdk)
2006-05-25 19:59:56 +00:00
Thomas Heller
9b83fc67ea
Clean up.
2006-05-05 19:14:24 +00:00
Thomas Heller
21a929f5ab
Export the 'free' standard C function for use in the test suite.
2006-05-05 18:42:14 +00:00
Hye-Shik Chang
f4795c82df
Fix build on MIPS for libffi. I haven't tested this yet because I
...
don't have an access on MIPS machines. Will be tested by buildbot. :)
2006-04-26 19:20:26 +00:00
Thomas Heller
4e1777de63
Fix compiler warnings on Darwin.
...
Patch by Brett Canon, see
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1475959&group_id=71702
2006-04-25 18:26:08 +00:00
Thomas Heller
4b75a7c1cf
Merge in changes from ctypes 0.9.9.6 upstream version.
2006-04-21 16:48:56 +00:00
Thomas Heller
b6dfaed903
Rename remaining StgDictObject's ffi_type fields to ffi_type_pointer.
2006-04-18 20:09:27 +00:00
Skip Montanaro
058be9adbc
C++ compiler cleanup: the typical few casts, and ... C++ didn't like that
...
the StgDictObject's ffi_type member had the same name as its type. I
changed that to ffi_type_pointer. Feel free to change it to something else
more meaningful, just not ffi_type.
2006-04-18 19:45:17 +00:00
Thomas Heller
9d89299fea
Fix refcounting.
...
This makes 'import ctypes; reload(ctypes)' no longer leak reference counts.
2006-04-18 14:57:39 +00:00
Thomas Heller
eb6f1835b1
Fix for FreeBSD. Fixes http://python.org/sf/1470353 .
...
Looks like a libffi bug.
2006-04-15 20:23:54 +00:00
Thomas Heller
55d031ef23
Fix for a bug found by Armin Rigo, plus test.
...
https://sourceforge.net/tracker/?func=detail&atid=532154&aid=1467852&group_id=71702
2006-04-12 19:07:36 +00:00
Neal Norwitz
b183a25c29
Fix some warnings on HP-UX when using cc/aCC
2006-04-10 01:03:32 +00:00
Thomas Heller
fff61ea025
Expose RTLD_LOCAL and RTLD_GLOBAL always from the _ctypes extension module.
...
If RTLD_LOCAL is not #defined in any header file (Windows), set it to 0.
If RTLD_GLOBAL is not #defined, set it equal to RTLD_LOCAL.
This should fix ctypes on cygwin.
2006-04-06 15:23:16 +00:00
Thomas Heller
430947ac66
Replace a few more 'char' types with 'signed char', to fix test failures
...
on platforms (ppc debian) where 'char' is unsigned.
2006-04-06 09:02:58 +00:00
Neal Norwitz
915ae41b3a
Handle error conditions from PyString_ConcatAndDel().
2006-04-06 08:06:52 +00:00
Neal Norwitz
b038333d4b
Handle ssize_t
...
No need to INCREF then let PyString_ConcatAndDel() DECREF. Just
use PyString_Concat().
Handle error condition if we can't concat.
2006-04-06 08:05:53 +00:00
Thomas Heller
3c423a04ba
Explicitely use 'signed char', to avoid problems on platforms with unsigned char type.
2006-04-05 20:34:18 +00:00
Thomas Heller
0890de3be0
Explicitely use 'signed char', to avoid problems on platforms with unsigned char type.
2006-04-05 19:51:19 +00:00
Thomas Heller
cdab455f9a
Try to fix the build on Mac OS X 10.3. The 'live_support' segment
...
attribute is not supported in this version.
2006-04-03 20:12:41 +00:00
Thomas Heller
db5483be64
Try to fix the tests on OpenBSD. Apparently OpenBSD passes
...
structure parameters differently than other posix-like systems.
2006-04-03 16:19:45 +00:00
Thomas Heller
3987df5adf
Try to build _ctypes on x86 openbsd.
2006-03-30 11:51:58 +00:00
Thomas Heller
bcfcccaf6e
Fix some int/Py_ssize_t issues which led to compiler warnings
...
on 64-bit platforms.
2006-03-22 13:21:16 +00:00
Thomas Heller
59feb6f5cc
Include <malloc.h> on windows, to avoid warnings when compiling with mingw.
...
Don't use SEH when compiling wth mingw.
Use IS_INTRESOURCE to determine function name from function ordinal.
Rewrite the code that allocates and frees callback functions, hopefully
this avoids the coverty warnings: Remove the THUNK typedef, and move the
definition of struct ffi_info into the header file.
2006-03-22 12:59:53 +00:00
Thomas Heller
e502693ee9
Avoid a potential double-free bug.
2006-03-20 14:22:05 +00:00
Thomas Heller
ba29e4c573
Apply patch from Martin v. Loewis: Avoid function pointer casts.
...
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1453037&group_id=71702
2006-03-20 10:22:42 +00:00
Thomas Heller
711e7f00ca
Fix another bug found by Coverty.
2006-03-20 08:29:28 +00:00
Thomas Heller
e2061dc48e
Fix bug found by Coverty.
2006-03-20 08:28:19 +00:00
Thomas Heller
d59ca8f335
Accessing unaligned structure fields works now on all architectures.
...
Including unittest.
2006-03-20 07:54:01 +00:00
Thomas Heller
f4063ca8bc
Fix compiler warning.
2006-03-18 12:52:54 +00:00
Thomas Heller
b03cb602e8
Merge changes from the upstream version:
...
- cast is implemented as a foreign function now
- On Windows, it is now possible to access functions exported by ordinal only
2006-03-17 15:52:58 +00:00
Thomas Heller
0c6b0e9d05
Fix a leak that would happen under error conditions (found by Coverty).
2006-03-16 20:02:36 +00:00
Thomas Heller
aa47570bdf
Use int 0 as default defval for LCID if nothing has been supplied.
2006-03-16 19:56:24 +00:00
Thomas Heller
b2167614f8
Fix compiler warning.
2006-03-16 19:34:56 +00:00
Thomas Heller
4c9dfc86f3
Fixes from Neal Norwitz, plus other small fixes.
2006-03-16 19:26:21 +00:00
Thomas Heller
127551637b
Rewrite the AllocFunctionCallback function for better error handling.
...
Hope that fixes one or two Coverty warnings.
2006-03-16 19:24:27 +00:00
Thomas Heller
9998f78d6d
Backport from upstream version: compatibility with older Python
...
versions.
2006-03-15 21:49:52 +00:00
Tim Peters
8ea61f1a83
Revert rev 43041, which introduced the "z" format qualifier
...
unique to Python 2.5.
2006-03-15 09:17:20 +00:00
Tim Peters
ab8aeba517
CField_repr(): PyString_FromFormat() understands the
...
C99 "z" qualifier on all platforms.
2006-03-15 08:41:15 +00:00
Thomas Heller
915d7773e2
Try to avoid many of the compiler warnings when compiling libffi by
...
using a proper function prototype.
2006-03-14 20:52:24 +00:00
Thomas Heller
ab906a562b
Cast an Py_ssize_t to int, to avoid a compiler warning.
2006-03-14 20:39:27 +00:00