我在整个网络上搜索过 can't seem to find文档甚至是 PyAPI_DATA() 功能的简单解释(即使它是 used in the Python header files 和 cited on python.org )。任何人都可以解释这是什么或指出我忽略的文档吗?
谢谢。
最佳答案
它用于标记公共(public) API 变量(因为 Python 的核心通常是一个动态库),例如在 Windows 上,它在编译核心时扩展为 extern __declspec(dllexport) RTYPE
,在例如编译时扩展为 extern __declspec(dllimport) RTYPE
。模块被编译。它在 Include/pyport.h
中定义。
关于python - PyAPI_DATA() 宏的解释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1655271/