Kaydet (Commit) 396ca574 authored tarafından Fred Drake's avatar Fred Drake

Document the rule that Python.h must be included before any standard

headers.  This is the final checkin for SF bug #458768.
üst 9b88b4c9
...@@ -76,6 +76,9 @@ API are included in your code by the following line: ...@@ -76,6 +76,9 @@ API are included in your code by the following line:
This implies inclusion of the following standard headers: This implies inclusion of the following standard headers:
\code{<stdio.h>}, \code{<string.h>}, \code{<errno.h>}, \code{<stdio.h>}, \code{<string.h>}, \code{<errno.h>},
\code{<limits.h>}, and \code{<stdlib.h>} (if available). \code{<limits.h>}, and \code{<stdlib.h>} (if available).
Since Python may define some pre-processor definitions which affect
the standard headers on some systems, you must include \file{Python.h}
before any standard headers are included.
All user visible names defined by Python.h (except those defined by All user visible names defined by Python.h (except those defined by
the included standard headers) have one of the prefixes \samp{Py} or the included standard headers) have one of the prefixes \samp{Py} or
......
...@@ -46,8 +46,11 @@ The first line of our file can be: ...@@ -46,8 +46,11 @@ The first line of our file can be:
which pulls in the Python API (you can add a comment describing the which pulls in the Python API (you can add a comment describing the
purpose of the module and a copyright notice if you like). purpose of the module and a copyright notice if you like).
Since Python may define some pre-processor definitions which affect
the standard headers on some systems, you must include \file{Python.h}
before any standard headers are included.
All user-visible symbols defined by \code{"Python.h"} have a prefix of All user-visible symbols defined by \file{Python.h} have a prefix of
\samp{Py} or \samp{PY}, except those defined in standard header files. \samp{Py} or \samp{PY}, except those defined in standard header files.
For convenience, and since they are used extensively by the Python For convenience, and since they are used extensively by the Python
interpreter, \code{"Python.h"} includes a few standard header files: interpreter, \code{"Python.h"} includes a few standard header files:
...@@ -951,7 +954,6 @@ Geoff Philbrick (\email{philbrick@hks.com}):% ...@@ -951,7 +954,6 @@ Geoff Philbrick (\email{philbrick@hks.com}):%
\index{Philbrick, Geoff} \index{Philbrick, Geoff}
\begin{verbatim} \begin{verbatim}
#include <stdio.h>
#include "Python.h" #include "Python.h"
static PyObject * static PyObject *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment