source: trunk/essentials/dev-lang/python/Include/Python.h@ 3315

Last change on this file since 3315 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 4.1 KB
Line 
1#ifndef Py_PYTHON_H
2#define Py_PYTHON_H
3/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
4
5/* Include nearly all Python header files */
6
7#include "patchlevel.h"
8#include "pyconfig.h"
9
10/* Cyclic gc is always enabled, starting with release 2.3a1. Supply the
11 * old symbol for the benefit of extension modules written before then
12 * that may be conditionalizing on it. The core doesn't use it anymore.
13 */
14#ifndef WITH_CYCLE_GC
15#define WITH_CYCLE_GC 1
16#endif
17
18#include <limits.h>
19
20#ifndef UCHAR_MAX
21#error "Something's broken. UCHAR_MAX should be defined in limits.h."
22#endif
23
24#if UCHAR_MAX != 255
25#error "Python's source code assumes C's unsigned char is an 8-bit type."
26#endif
27
28#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
29#define _SGI_MP_SOURCE
30#endif
31
32#include <stdio.h>
33#ifndef NULL
34# error "Python.h requires that stdio.h define NULL."
35#endif
36
37#include <string.h>
38#ifdef HAVE_ERRNO_H
39#include <errno.h>
40#endif
41#include <stdlib.h>
42#ifdef HAVE_UNISTD_H
43#include <unistd.h>
44#endif
45
46/* For uintptr_t, intptr_t */
47#ifdef HAVE_STDDEF_H
48#include <stddef.h>
49#endif
50
51/* CAUTION: Build setups should ensure that NDEBUG is defined on the
52 * compiler command line when building Python in release mode; else
53 * assert() calls won't be removed.
54 */
55#include <assert.h>
56
57#include "pyport.h"
58
59/* pyconfig.h or pyport.h may or may not define DL_IMPORT */
60#ifndef DL_IMPORT /* declarations for DLL import/export */
61#define DL_IMPORT(RTYPE) RTYPE
62#endif
63#ifndef DL_EXPORT /* declarations for DLL import/export */
64#define DL_EXPORT(RTYPE) RTYPE
65#endif
66
67/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
68 * PYMALLOC_DEBUG is in error if pymalloc is not in use.
69 */
70#if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
71#define PYMALLOC_DEBUG
72#endif
73#if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
74#error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
75#endif
76#include "pymem.h"
77
78#include "object.h"
79#include "objimpl.h"
80
81#include "pydebug.h"
82
83#include "unicodeobject.h"
84#include "intobject.h"
85#include "boolobject.h"
86#include "longobject.h"
87#include "floatobject.h"
88#ifndef WITHOUT_COMPLEX
89#include "complexobject.h"
90#endif
91#include "rangeobject.h"
92#include "stringobject.h"
93#include "bufferobject.h"
94#include "tupleobject.h"
95#include "listobject.h"
96#include "dictobject.h"
97#include "enumobject.h"