Ned Deily <n...@acm.org> added the comment: An endian issue? (i.e. on OS X, it works on ppc but not Intel) A slightly more detailed test case:
$ more test_ctypes.py import ctypes class Blah2(ctypes.Structure): _fields_ = [("x", ctypes.c_uint64, 64), ("y", ctypes.c_uint64)] val = 0x0123456789ABCDEF x = Blah2(val, val) print(Blah2.x) print(hex(x.x)) print(Blah2.y) print(hex(x.y)) $ arch -i386 python2.7 test_ctypes.py <Field type=c_ulonglong, ofs=0:0, bits=64> 0x0L <Field type=c_ulonglong, ofs=8, size=8> 0x123456789abcdefL $ arch -x86_64 python2.7 test_ctypes.py <Field type=c_ulong, ofs=0:0, bits=64> 0x0L <Field type=c_ulong, ofs=8, size=8> 0x123456789abcdefL $ arch -ppc python2.7 test_ctypes.py <Field type=c_ulonglong, ofs=0:0, bits=64> 0x123456789abcdefL <Field type=c_ulonglong, ofs=8, size=8> 0x123456789abcdefL ---------- nosy: +ned.deily _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9989> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com