mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
Fix the bitfield test when _ctypes is compiled with MingW. Structures
containing bitfields may have different layout on MSVC and MingW .
This commit is contained in:
parent
aa1919d2b0
commit
9ba7ca8229
1 changed files with 2 additions and 2 deletions
|
@ -65,10 +65,10 @@ CField_FromDesc(PyObject *desc, int index,
|
||||||
}
|
}
|
||||||
if (bitsize /* this is a bitfield request */
|
if (bitsize /* this is a bitfield request */
|
||||||
&& *pfield_size /* we have a bitfield open */
|
&& *pfield_size /* we have a bitfield open */
|
||||||
#ifdef MS_WIN32
|
#if defined(MS_WIN32) && !defined(__MINGW32__)
|
||||||
&& dict->size * 8 == *pfield_size /* MSVC */
|
&& dict->size * 8 == *pfield_size /* MSVC */
|
||||||
#else
|
#else
|
||||||
&& dict->size * 8 <= *pfield_size /* GCC */
|
&& dict->size * 8 <= *pfield_size /* GCC, MINGW */
|
||||||
#endif
|
#endif
|
||||||
&& (*pbitofs + bitsize) <= *pfield_size) {
|
&& (*pbitofs + bitsize) <= *pfield_size) {
|
||||||
/* continue bit field */
|
/* continue bit field */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue