【发布时间】:2022-11-24 19:55:45
【问题描述】:
在 Cython 中,可以通过从 stdint 导入它们来使用精确宽度的整数类型,例如
from libc.stdint cimport int32_t
查看stdint.pxd,我们看到int32_t被定义为
cdef extern from "<stdint.h>" nogil:
...
ctypedef signed int int32_t
这是否意味着如果我在我的 Cython 代码中使用 int32_t,这种类型只是 signed int (int) 的别名,实际上可能是 only 16 bits wide?
对于所有其他整数类型,问题都是相同的。
【问题讨论】:
-
你能说出 Cython 官方支持的非 ILP32 或 LP64 的任何架构吗?
-
我不知道。是否有 Cython 支持的平台列表/声明?
-
@jmd_dk 在文档中找不到突出的一个,但是 Makefile 中的
MANYLINUX_IMAGES给出了提示:i686、x86_64、aarch64。
标签: c integer cython portability fixed-width