Skip to content

Commit d0c5c25

Browse files
committed
exports fix 2
1 parent 0164c79 commit d0c5c25

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

Doc/c-api/intro.rst

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ complete listing.
222222
Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function
223223
be inlined.
224224

225+
.. c:macro:: Py_LOCAL_SYMBOL
226+
227+
Macro used to declare a symbol as local to the shared library (hidden).
228+
It ensures the symbol is not exported.
229+
On platforms with visibility support, it
230+
expands to ``__attribute__((visibility("hidden")))``.
231+
225232
.. c:macro:: Py_MAX(x, y)
226233
227234
Return the maximum value between ``x`` and ``y``.
@@ -378,17 +385,27 @@ complete listing.
378385

379386
.. c:macro:: Py_EXPORTED_SYMBOL
380387
381-
Macro used to declare a symbol (function or data) as exported from a shared library.
388+
Macro used to declare a symbol (function or data) as exported.
382389
On Windows, this expands to ``__declspec(dllexport)``.
383390
On other platforms with visibility support, it
384391
expands to ``__attribute__((visibility("default")))``.
392+
This macro is for defining the C API itself; extension modules should not use it.
385393

386394

387395
.. c:macro:: Py_IMPORTED_SYMBOL
388396
389-
Macro used to declare a symbol as imported from a shared library.
397+
Macro used to declare a symbol as imported.
390398
On Windows, this expands to ``__declspec(dllimport)``.
391399
On other platforms, it is usually empty or standard visibility.
400+
This macro is for defining the C API itself; extension modules should not use it.
401+
402+
403+
.. c:macro:: PyAPI_FUNC(type)
404+
405+
Macro used by CPython to declare a function as part of the C API.
406+
Its expansion depends on the platform and build configuration.
407+
This macro is intended for defining CPython's C API itself;
408+
extension modulesshould not use it for their own symbols.
392409

393410

394411
.. c:macro:: PyAPI_DATA(type)
@@ -402,14 +419,6 @@ complete listing.
402419
PyAPI_DATA(PyObject *) _Py_NoneStruct;
403420

404421

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-
412-
413422
.. _api-objects:
414423

415424
Objects, Types and Reference Counts

0 commit comments

Comments
 (0)