source: NonGTP/Boost/boost/python/detail/python22_fixed.h @ 857

Revision 857, 3.8 KB checked in by igarcia, 19 years ago (diff)
Line 
1// This file is a modified version of Python 2.2/2.2.1 Python.h. As
2// such it is:
3//
4//    Copyright (c) 2001, 2002 Python Software Foundation; All Rights
5//    Reserved
6//
7// Changes from the original:
8//  1. #includes <unistd.h> for Python 2.2.1
9//  2. Provides missing extern "C" wrapper for  "iterobject.h" and  "descrobject.h".
10//
11
12// Changes marked with "Boost.Python modification"
13#ifndef Py_PYTHON_H
14#define Py_PYTHON_H
15/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
16
17
18/* Enable compiler features; switching on C lib defines doesn't work
19   here, because the symbols haven't necessarily been defined yet. */
20#ifndef _GNU_SOURCE
21# define _GNU_SOURCE    1
22#endif
23
24/* Forcing SUSv2 compatibility still produces problems on some
25   platforms, True64 and SGI IRIX begin two of them, so for now the
26   define is switched off. */
27#if 0
28#ifndef _XOPEN_SOURCE
29# define _XOPEN_SOURCE  500
30#endif
31#endif
32
33/* Include nearly all Python header files */
34
35#include "patchlevel.h"
36#include "pyconfig.h"
37
38#ifdef HAVE_LIMITS_H
39#include <limits.h>
40#endif
41
42/* pyconfig.h may or may not define DL_IMPORT */
43#ifndef DL_IMPORT       /* declarations for DLL import/export */
44#define DL_IMPORT(RTYPE) RTYPE
45#endif
46#ifndef DL_EXPORT       /* declarations for DLL import/export */
47#define DL_EXPORT(RTYPE) RTYPE
48#endif
49
50#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
51#define _SGI_MP_SOURCE
52#endif
53
54#include <stdio.h>
55#ifndef NULL
56#   error "Python.h requires that stdio.h define NULL."
57#endif
58
59#include <string.h>
60#include <errno.h>
61#ifdef HAVE_STDLIB_H
62#include <stdlib.h>
63#endif
64#if PY_MICRO_VERSION == 1 // Boost.Python modification: emulate Python 2.2
65#ifdef HAVE_UNISTD_H
66#include <unistd.h>
67#endif
68#endif // Boost.Python modification: emulate Python 2.2
69
70/* CAUTION:  Build setups should ensure that NDEBUG is defined on the
71 * compiler command line when building Python in release mode; else
72 * assert() calls won't be removed.
73 */
74#include <assert.h>
75
76#include "pyport.h"
77
78#include "pymem.h"
79
80#include "object.h"
81#include "objimpl.h"
82
83#include "pydebug.h"
84
85#include "unicodeobject.h"
86#include "intobject.h"
87#include "longobject.h"
88#include "floatobject.h"
89#ifndef WITHOUT_COMPLEX
90#include "complexobject.h"
91#endif
92#include "rangeobject.h"
93#include "stringobject.h"
94#include "bufferobject.h"
95#include "tupleobject.h"
96#include "listobject.h"
97#include "dictobject.h"
98#include "methodobject.h"
99#include "moduleobject.h"
100#include "funcobject.h"
101#include "classobject.h"
102#include "fileobject.h"
103#include "cobject.h"
104#include "traceback.h"
105#include "sliceobject.h"
106#include "cellobject.h"
107extern "C" { // Boost.Python modification: provide missing extern "C"
108#include "iterobject.h"
109#include "descrobject.h"
110} // Boost.Python modification: provide missing extern "C"
111#include "weakrefobject.h"
112
113#include "codecs.h"
114#include "pyerrors.h"
115
116#include "pystate.h"
117
118#include "modsupport.h"
119#include "pythonrun.h"
120#include "ceval.h"
121#include "sysmodule.h"
122#include "intrcheck.h"
123#include "import.h"
124
125#include "abstract.h"
126
127#define PyArg_GetInt(v, a)      PyArg_Parse((v), "i", (a))
128#define PyArg_NoArgs(v)         PyArg_Parse(v, "")
129
130/* Convert a possibly signed character to a nonnegative int */
131/* XXX This assumes characters are 8 bits wide */
132#ifdef __CHAR_UNSIGNED__
133#define Py_CHARMASK(c)          (c)
134#else
135#define Py_CHARMASK(c)          ((c) & 0xff)
136#endif
137
138#include "pyfpe.h"
139
140/* These definitions must match corresponding definitions in graminit.h.
141   There's code in compile.c that checks that they are the same. */
142#define Py_single_input 256
143#define Py_file_input 257
144#define Py_eval_input 258
145
146#ifdef HAVE_PTH
147/* GNU pth user-space thread support */
148#include <pth.h>
149#endif
150#endif /* !Py_PYTHON_H */
Note: See TracBrowser for help on using the repository browser.