Skip to content

Commit 049c252

Browse files
encukouStanFromIrelandmerwokdnicolodiZeroIntensity
authored
gh-134160: Start "Extending and embedding" with a Diataxis-style tutorial (GH-142314)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Daniele Nicolodi <daniele@grinta.net> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
1 parent 685272e commit 049c252

File tree

5 files changed

+885
-384
lines changed

5 files changed

+885
-384
lines changed

Doc/c-api/intro.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,46 @@ header files properly declare the entry points to be ``extern "C"``. As a result
107107
there is no need to do anything special to use the API from C++.
108108

109109

110+
.. _capi-system-includes:
111+
112+
System includes
113+
---------------
114+
115+
:file:`Python.h` includes several standard header files.
116+
C extensions should include the standard headers that they use,
117+
and should not rely on these implicit includes.
118+
The implicit includes are:
119+
120+
* ``<assert.h>``
121+
* ``<intrin.h>`` (on Windows)
122+
* ``<inttypes.h>``
123+
* ``<limits.h>``
124+
* ``<math.h>``
125+
* ``<stdarg.h>``
126+
* ``<wchar.h>``
127+
* ``<sys/types.h>`` (if present)
128+
129+
The following are included for backwards compatibility, unless using
130+
:ref:`Limited API <limited-c-api>` 3.13 or newer:
131+
132+
* ``<ctype.h>``
133+
* ``<unistd.h>`` (on POSIX)
134+
135+
The following are included for backwards compatibility, unless using
136+
:ref:`Limited API <limited-c-api>` 3.11 or newer:
137+
138+
* ``<errno.h>``
139+
* ``<stdio.h>``
140+
* ``<stdlib.h>``
141+
* ``<string.h>``
142+
143+
.. note::
144+
145+
Since Python may define some pre-processor definitions which affect the standard
146+
headers on some systems, you *must* include :file:`Python.h` before any standard
147+
headers are included.
148+
149+
110150
Useful macros
111151
=============
112152

0 commit comments

Comments
 (0)