eryksun added the comment:
It's not correct that "[The c_int] type is an alias for the c_long type on
32-bit systems". Actually it's an alias if int and long are the same size.
Here's the relevant snippet from __init__:
if _calcsize("i") == _calcsize("l"):
# if int and long have the same size, make c_int an alias for c_long
c_int = c_long
c_uint = c_ulong
else:
class c_int(_SimpleCData):
_type_ = "i"
_check_size(c_int)
class c_uint(_SimpleCData):
_type_ = "I"
_check_size(c_uint)
Notably, int and long are the same size on 64-bit Windows:
>>> sizeof(c_void_p) # 64-bit
8
>>> c_int
<class 'ctypes.c_long'>
>>> sizeof(c_long)
4
----------
nosy: +eryksun
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16192>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com