PyAPI_DATA () macro explanation?

I searched all over the Internet and cannot find documentation or even a simple explanation of what PyAPI_DATA () does (although it is used in Python header files and quoted from python.org ). Can someone explain what this means, or point me to the documentation that I am missing?

Thanks.

+3
source share
1 answer

It is used to denote public API variables (since the Python core is usually a dynamic library), for example. on Windows, it expands to extern __declspec(dllexport) RTYPEwhen the kernel is compiled and extern __declspec(dllimport) RTYPEwhen, for example, the modules are compiled. He is defined in Include/pyport.h.

+5
source

Source: https://habr.com/ru/post/1721592/


All Articles