Chris@16: // This file is a modified version of Python 2.2/2.2.1 Python.h. As Chris@16: // such it is: Chris@16: // Chris@16: // Copyright (c) 2001, 2002 Python Software Foundation; All Rights Chris@16: // Reserved Chris@16: // Chris@16: // boostinspect:nolicense (don't complain about the lack of a Boost license) Chris@16: // Chris@16: // Changes from the original: Chris@16: // 1. #includes for Python 2.2.1 Chris@16: // 2. Provides missing extern "C" wrapper for "iterobject.h" and "descrobject.h". Chris@16: // Chris@16: Chris@16: // Changes marked with "Boost.Python modification" Chris@16: #ifndef Py_PYTHON_H Chris@16: #define Py_PYTHON_H Chris@16: /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ Chris@16: Chris@16: Chris@16: /* Enable compiler features; switching on C lib defines doesn't work Chris@16: here, because the symbols haven't necessarily been defined yet. */ Chris@16: #ifndef _GNU_SOURCE Chris@16: # define _GNU_SOURCE 1 Chris@16: #endif Chris@16: Chris@16: /* Forcing SUSv2 compatibility still produces problems on some Chris@16: platforms, True64 and SGI IRIX begin two of them, so for now the Chris@16: define is switched off. */ Chris@16: #if 0 Chris@16: #ifndef _XOPEN_SOURCE Chris@16: # define _XOPEN_SOURCE 500 Chris@16: #endif Chris@16: #endif Chris@16: Chris@16: /* Include nearly all Python header files */ Chris@16: Chris@16: #include "patchlevel.h" Chris@16: #include "pyconfig.h" Chris@16: Chris@16: #ifdef HAVE_LIMITS_H Chris@16: #include Chris@16: #endif Chris@16: Chris@16: /* pyconfig.h may or may not define DL_IMPORT */ Chris@16: #ifndef DL_IMPORT /* declarations for DLL import/export */ Chris@16: #define DL_IMPORT(RTYPE) RTYPE Chris@16: #endif Chris@16: #ifndef DL_EXPORT /* declarations for DLL import/export */ Chris@16: #define DL_EXPORT(RTYPE) RTYPE Chris@16: #endif Chris@16: Chris@16: #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) Chris@16: #define _SGI_MP_SOURCE Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #ifndef NULL Chris@16: # error "Python.h requires that stdio.h define NULL." Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: #ifdef HAVE_STDLIB_H Chris@16: #include Chris@16: #endif Chris@16: #if PY_MICRO_VERSION == 1 // Boost.Python modification: emulate Python 2.2 Chris@16: #ifdef HAVE_UNISTD_H Chris@16: #include Chris@16: #endif Chris@16: #endif // Boost.Python modification: emulate Python 2.2 Chris@16: Chris@16: /* CAUTION: Build setups should ensure that NDEBUG is defined on the Chris@16: * compiler command line when building Python in release mode; else Chris@16: * assert() calls won't be removed. Chris@16: */ Chris@16: #include Chris@16: Chris@16: #include "pyport.h" Chris@16: Chris@16: #include "pymem.h" Chris@16: Chris@16: #include "object.h" Chris@16: #include "objimpl.h" Chris@16: Chris@16: #include "pydebug.h" Chris@16: Chris@16: #include "unicodeobject.h" Chris@16: #include "intobject.h" Chris@16: #include "longobject.h" Chris@16: #include "floatobject.h" Chris@16: #ifndef WITHOUT_COMPLEX Chris@16: #include "complexobject.h" Chris@16: #endif Chris@16: #include "rangeobject.h" Chris@16: #include "stringobject.h" Chris@16: #include "bufferobject.h" Chris@16: #include "tupleobject.h" Chris@16: #include "listobject.h" Chris@16: #include "dictobject.h" Chris@16: #include "methodobject.h" Chris@16: #include "moduleobject.h" Chris@16: #include "funcobject.h" Chris@16: #include "classobject.h" Chris@16: #include "fileobject.h" Chris@16: #include "cobject.h" Chris@16: #include "traceback.h" Chris@16: #include "sliceobject.h" Chris@16: #include "cellobject.h" Chris@16: extern "C" { // Boost.Python modification: provide missing extern "C" Chris@16: #include "iterobject.h" Chris@16: #include "descrobject.h" Chris@16: } // Boost.Python modification: provide missing extern "C" Chris@16: #include "weakrefobject.h" Chris@16: Chris@16: #include "codecs.h" Chris@16: #include "pyerrors.h" Chris@16: Chris@16: #include "pystate.h" Chris@16: Chris@16: #include "modsupport.h" Chris@16: #include "pythonrun.h" Chris@16: #include "ceval.h" Chris@16: #include "sysmodule.h" Chris@16: #include "intrcheck.h" Chris@16: #include "import.h" Chris@16: Chris@16: #include "abstract.h" Chris@16: Chris@16: #define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a)) Chris@16: #define PyArg_NoArgs(v) PyArg_Parse(v, "") Chris@16: Chris@16: /* Convert a possibly signed character to a nonnegative int */ Chris@16: /* XXX This assumes characters are 8 bits wide */ Chris@16: #ifdef __CHAR_UNSIGNED__ Chris@16: #define Py_CHARMASK(c) (c) Chris@16: #else Chris@16: #define Py_CHARMASK(c) ((c) & 0xff) Chris@16: #endif Chris@16: Chris@16: #include "pyfpe.h" Chris@16: Chris@16: /* These definitions must match corresponding definitions in graminit.h. Chris@16: There's code in compile.c that checks that they are the same. */ Chris@16: #define Py_single_input 256 Chris@16: #define Py_file_input 257 Chris@16: #define Py_eval_input 258 Chris@16: Chris@16: #ifdef HAVE_PTH Chris@16: /* GNU pth user-space thread support */ Chris@16: #include Chris@16: #endif Chris@16: #endif /* !Py_PYTHON_H */