Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.13] gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508) #143787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
miss-islington wants to merge 1 commit into python:3.13
base: 3.13
Choose a base branch
Loading
from miss-islington:backport-a7ba3b1-3.13
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Doc/c-api/intro.rst
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ complete listing.
Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function
be inlined.

.. c:macro:: Py_LOCAL_SYMBOL

Macro used to declare a symbol as local to the shared library (hidden).
On supported platforms, it ensures the symbol is not exported.

On compatible versions of GCC/Clang, it
expands to ``__attribute__((visibility("hidden")))``.

.. c:macro:: Py_MAX(x, y)

Return the maximum value between ``x`` and ``y``.
Expand Down Expand Up @@ -340,6 +348,38 @@ complete listing.
sizeof(array) / sizeof((array)[0])


.. c:macro:: Py_EXPORTED_SYMBOL

Macro used to declare a symbol (function or data) as exported.
On Windows, this expands to ``__declspec(dllexport)``.
On compatible versions of GCC/Clang, it
expands to ``__attribute__((visibility("default")))``.
This macro is for defining the C API itself; extension modules should not use it.


.. c:macro:: Py_IMPORTED_SYMBOL

Macro used to declare a symbol as imported.
On Windows, this expands to ``__declspec(dllimport)``.
This macro is for defining the C API itself; extension modules should not use it.


.. c:macro:: PyAPI_FUNC(type)

Macro used by CPython to declare a function as part of the C API.
Its expansion depends on the platform and build configuration.
This macro is intended for defining CPython's C API itself;
extension modules should not use it for their own symbols.


.. c:macro:: PyAPI_DATA(type)

Macro used by CPython to declare a public global variable as part of the C API.
Its expansion depends on the platform and build configuration.
This macro is intended for defining CPython's C API itself;
extension modules should not use it for their own symbols.


.. _api-objects:

Objects, Types and Reference Counts
Expand Down
5 changes: 0 additions & 5 deletions Tools/check-c-api-docs/ignored_c_api.txt
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ Py_HasFileSystemDefaultEncoding
Py_UTF8Mode
# pyhash.h
Py_HASH_EXTERNAL
# exports.h
PyAPI_DATA
Py_EXPORTED_SYMBOL
Py_IMPORTED_SYMBOL
Py_LOCAL_SYMBOL
# modsupport.h
PyABIInfo_FREETHREADING_AGNOSTIC
# moduleobject.h
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /