Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 396ca57

Browse files
committed
Document the rule that Python.h must be included before any standard
headers. This is the final checkin for SF bug #458768.
1 parent 9b88b4c commit 396ca57

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Doc/api/api.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ \section{Include Files \label{includes}}
7676
This implies inclusion of the following standard headers:
7777
\code{<stdio.h>}, \code{<string.h>}, \code{<errno.h>},
7878
\code{<limits.h>}, and \code{<stdlib.h>} (if available).
79+
Since Python may define some pre-processor definitions which affect
80+
the standard headers on some systems, you must include \file{Python.h}
81+
before any standard headers are included.
7982

8083
All user visible names defined by Python.h (except those defined by
8184
the included standard headers) have one of the prefixes \samp{Py} or

Doc/ext/extending.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ \section{A Simple Example
4646

4747
which pulls in the Python API (you can add a comment describing the
4848
purpose of the module and a copyright notice if you like).
49+
Since Python may define some pre-processor definitions which affect
50+
the standard headers on some systems, you must include \file{Python.h}
51+
before any standard headers are included.
4952

50-
All user-visible symbols defined by \code{"Python.h"} have a prefix of
53+
All user-visible symbols defined by \file{Python.h} have a prefix of
5154
\samp{Py} or \samp{PY}, except those defined in standard header files.
5255
For convenience, and since they are used extensively by the Python
5356
interpreter, \code{"Python.h"} includes a few standard header files:
@@ -951,7 +954,6 @@ \section{Keyword Parameters for Extension Functions
951954
\index{Philbrick, Geoff}
952955

953956
\begin{verbatim}
954-
#include <stdio.h>
955957
#include "Python.h"
956958
957959
static PyObject *

0 commit comments

Comments
 (0)