5

I've searched all over the web and can't seem to find documentation or even a simple explanation of what PyAPI_DATA() does (even though it is used in the Python header files and cited on python.org). Could anyone care to explain what this is or point me to documentation I am overlooking?

Thanks.

Michael
  • 4,700
  • 9
  • 35
  • 42

1 Answers1

9

It's used to mark public API variables (as Python's core is usually a dynamic library), e.g. on Windows, it's expanded to extern __declspec(dllexport) RTYPE when core is compiled and to extern __declspec(dllimport) RTYPE when e.g. modules are compiled. It's defined in Include/pyport.h.

Cat Plus Plus
  • 125,936
  • 27
  • 200
  • 224