Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a702fd53
Commit
a702fd53
authored
Sep 29, 2008
by
Thomas Heller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #3547 for MingW, update comments (backport from trunk).
parent
70f1192d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
Lib/ctypes/test/test_bitfields.py
Lib/ctypes/test/test_bitfields.py
+3
-2
Modules/_ctypes/cfield.c
Modules/_ctypes/cfield.c
+5
-3
No files found.
Lib/ctypes/test/test_bitfields.py
View file @
a702fd53
...
...
@@ -223,8 +223,9 @@ class BitFieldTest(unittest.TestCase):
(
"d"
,
c_short
,
4
),
(
"e"
,
c_short
,
4
),
(
"f"
,
c_int
,
24
)]
# MS compilers do NOT combine c_short and c_int into
# one field, gcc does.
# MSVC does NOT combine c_short and c_int into one field, GCC
# does (unless GCC is run with '-mms-bitfields' which
# produces code compatible with MSVC).
if
os
.
name
in
(
"nt"
,
"ce"
):
self
.
failUnlessEqual
(
sizeof
(
X
),
sizeof
(
c_int
)
*
4
)
else
:
...
...
Modules/_ctypes/cfield.c
View file @
a702fd53
...
...
@@ -65,10 +65,12 @@ CField_FromDesc(PyObject *desc, int index,
}
if
(
bitsize
/* this is a bitfield request */
&&
*
pfield_size
/* we have a bitfield open */
#if defined(MS_WIN32) && !defined(__MINGW32__)
&&
dict
->
size
*
8
==
*
pfield_size
/* MSVC */
#ifdef MS_WIN32
/* MSVC, GCC with -mms-bitfields */
&&
dict
->
size
*
8
==
*
pfield_size
#else
&&
dict
->
size
*
8
<=
*
pfield_size
/* GCC, MINGW */
/* GCC */
&&
dict
->
size
*
8
<=
*
pfield_size
#endif
&&
(
*
pbitofs
+
bitsize
)
<=
*
pfield_size
)
{
/* continue bit field */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment