You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the size of 'sec' in DmtxTime(wrapper.py) is fixed to c_ulonglong which is not always true, it should keep the same size with time_t in C library. since time_t can be 32bits or 64bits according the exactly system, the defination of sec should also be changed by system. next patch can fix this problem(refer from: python/cpython#92869)
import platform
import ctypes
......
time_t=ctypes.c_int64
if platform.system() == 'Windows':
# Assume MSVC(?) - what about mingw/clang?
time_t = ctypes.c_int64
elif ctypes.sizeof(ctypes.c_void_p) == ctypes.sizeof(ctypes.c_int64):
# 64-bit platform of any kind - assume 64-bit time_t(?)
time_t = ctypes.c_int64
else:
# assume some kind of 32-bit platform(?)
time_t = ctypes.c_int32
class DmtxTime(Structure): fields = [
#('sec', c_ulong), # Actually a time_t
('sec',time_t),
('usec', c_ulong),
]
The text was updated successfully, but these errors were encountered:
the size of 'sec' in DmtxTime(wrapper.py) is fixed to c_ulonglong which is not always true, it should keep the same size with time_t in C library. since time_t can be 32bits or 64bits according the exactly system, the defination of sec should also be changed by system. next patch can fix this problem(refer from: python/cpython#92869)
import platform
import ctypes
......
time_t=ctypes.c_int64
if platform.system() == 'Windows':
# Assume MSVC(?) - what about mingw/clang?
time_t = ctypes.c_int64
elif ctypes.sizeof(ctypes.c_void_p) == ctypes.sizeof(ctypes.c_int64):
# 64-bit platform of any kind - assume 64-bit time_t(?)
time_t = ctypes.c_int64
else:
# assume some kind of 32-bit platform(?)
time_t = ctypes.c_int32
class DmtxTime(Structure):
fields = [
#('sec', c_ulong), # Actually a time_t
('sec',time_t),
('usec', c_ulong),
]
The text was updated successfully, but these errors were encountered: