diff options
| author | Thomas Heller <theller@ctypes.org> | 2006-07-05 09:13:56 (GMT) |
|---|---|---|
| committer | Thomas Heller <theller@ctypes.org> | 2006-07-05 09:13:56 (GMT) |
| commit | 9ba7ca82298fabe84b633514317d795b42eef770 (patch) | |
| tree | 9b3df3df2beebefc932d97121dda29212b4b3f07 | |
| parent | aa1919d2b0f256529a992d4083f7a8012ca1c417 (diff) | |
| download | cpython-9ba7ca82298fabe84b633514317d795b42eef770.zip cpython-9ba7ca82298fabe84b633514317d795b42eef770.tar.gz cpython-9ba7ca82298fabe84b633514317d795b42eef770.tar.bz2 | |
Fix the bitfield test when _ctypes is compiled with MingW. Structures
containing bitfields may have different layout on MSVC and MingW .
| -rw-r--r-- | Modules/_ctypes/cfield.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 68fac67..c5895f0 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -65,10 +65,10 @@ CField_FromDesc(PyObject *desc, int index, } if (bitsize /* this is a bitfield request */ && *pfield_size /* we have a bitfield open */ -#ifdef MS_WIN32 +#if defined(MS_WIN32) && !defined(__MINGW32__) && dict->size * 8 == *pfield_size /* MSVC */ #else - && dict->size * 8 <= *pfield_size /* GCC */ + && dict->size * 8 <= *pfield_size /* GCC, MINGW */ #endif && (*pbitofs + bitsize) <= *pfield_size) { /* continue bit field */ |
