@@ -376,6 +376,39 @@ complete listing.
376376 sizeof(array) / sizeof((array)[0])
377377
378378
379+ .. c :macro :: Py_EXPORTED_SYMBOL
380+
381+ Macro used to declare a symbol (function or data) as exported from a shared library.
382+ On Windows, this expands to ``__declspec(dllexport) ``.
383+ On other platforms with visibility support, it
384+ expands to ``__attribute__((visibility("default"))) ``.
385+
386+
387+ .. c :macro :: Py_IMPORTED_SYMBOL
388+
389+ Macro used to declare a symbol as imported from a shared library.
390+ On Windows, this expands to ``__declspec(dllimport) ``.
391+ On other platforms, it is usually empty or standard visibility.
392+
393+
394+ .. c :macro :: PyAPI_DATA(type)
395+
396+ Macro used to declare a public global variable.
397+ It expands to ``extern Py_EXPORTED_SYMBOL type `` or ``extern Py_IMPORTED_SYMBOL type ``
398+ depending on whether the core is being built or used.
399+
400+ Example usage::
401+
402+ PyAPI_DATA(PyObject *) _Py_NoneStruct;
403+
404+
405+ .. c :macro :: Py_LOCAL_SYMBOL
406+
407+ Macro used to declare a symbol as local to the shared library (hidden).
408+ It ensures the symbol is not exported.
409+ On platforms with visibility support, it
410+ expands to ``__attribute__((visibility("hidden"))) ``.
411+
379412.. _api-objects :
380413
381414Objects, Types and Reference Counts
0 commit comments