aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-01-14 12:54:35 +0100
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-01-14 12:54:35 +0100
commit76f2d103d60e9d4e843b0bbeccd4560737839e1c (patch)
tree677d768f7345a01b4f1bc3cae8f16e2a8b9cfdfc /lib_pypy
parentAdd some checks about bitfields in ctypes.Structure (diff)
downloadpypy-76f2d103d60e9d4e843b0bbeccd4560737839e1c.tar.gz
pypy-76f2d103d60e9d4e843b0bbeccd4560737839e1c.tar.bz2
pypy-76f2d103d60e9d4e843b0bbeccd4560737839e1c.zip
ctypes: Add support for Structure._pack_
Diffstat (limited to 'lib_pypy')
-rw-r--r--lib_pypy/_ctypes/structure.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib_pypy/_ctypes/structure.py b/lib_pypy/_ctypes/structure.py
index f309e1ae4d..ac89e0a0c8 100644
--- a/lib_pypy/_ctypes/structure.py
+++ b/lib_pypy/_ctypes/structure.py
@@ -71,7 +71,8 @@ class Field(object):
# ________________________________________________________________
def _set_shape(tp, rawfields, is_union=False):
- tp._ffistruct = _rawffi.Structure(rawfields, is_union)
+ tp._ffistruct = _rawffi.Structure(rawfields, is_union,
+ getattr(self, '_pack_', 0))
tp._ffiargshape = tp._ffishape = (tp._ffistruct, 1)
tp._fficompositesize = tp._ffistruct.size