Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame^] | 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 | #include "pymacconfig.h" |
| 10 | |
| 11 | #include <limits.h> |
| 12 | |
| 13 | #ifndef UCHAR_MAX |
| 14 | #error "Something's broken. UCHAR_MAX should be defined in limits.h." |
| 15 | #endif |
| 16 | |
| 17 | #if UCHAR_MAX != 255 |
| 18 | #error "Python's source code assumes C's unsigned char is an 8-bit type." |
| 19 | #endif |
| 20 | |
| 21 | #if defined(__sgi) && !defined(_SGI_MP_SOURCE) |
| 22 | #define _SGI_MP_SOURCE |
| 23 | #endif |
| 24 | |
| 25 | #include <stdio.h> |
| 26 | #ifndef NULL |
| 27 | # error "Python.h requires that stdio.h define NULL." |
| 28 | #endif |
| 29 | |
| 30 | #include <string.h> |
| 31 | #ifdef HAVE_ERRNO_H |
| 32 | #include <errno.h> |
| 33 | #endif |
| 34 | #include <stdlib.h> |
| 35 | #ifndef MS_WINDOWS |
| 36 | #include <unistd.h> |
| 37 | #endif |
| 38 | #ifdef HAVE_CRYPT_H |
| 39 | #if defined(HAVE_CRYPT_R) && !defined(_GNU_SOURCE) |
| 40 | /* Required for glibc to expose the crypt_r() function prototype. */ |
| 41 | # define _GNU_SOURCE |
| 42 | # define _Py_GNU_SOURCE_FOR_CRYPT |
| 43 | #endif |
| 44 | #include <crypt.h> |
| 45 | #ifdef _Py_GNU_SOURCE_FOR_CRYPT |
| 46 | /* Don't leak the _GNU_SOURCE define to other headers. */ |
| 47 | # undef _GNU_SOURCE |
| 48 | # undef _Py_GNU_SOURCE_FOR_CRYPT |
| 49 | #endif |
| 50 | #endif |
| 51 | |
| 52 | /* For size_t? */ |
| 53 | #ifdef HAVE_STDDEF_H |
| 54 | #include <stddef.h> |
| 55 | #endif |
| 56 | |
| 57 | /* CAUTION: Build setups should ensure that NDEBUG is defined on the |
| 58 | * compiler command line when building Python in release mode; else |
| 59 | * assert() calls won't be removed. |
| 60 | */ |
| 61 | #include <assert.h> |
| 62 | |
| 63 | #include "pyport.h" |
| 64 | #include "pymacro.h" |
| 65 | |
| 66 | /* A convenient way for code to know if clang's memory sanitizer is enabled. */ |
| 67 | #if defined(__has_feature) |
| 68 | # if __has_feature(memory_sanitizer) |
| 69 | # if !defined(_Py_MEMORY_SANITIZER) |
| 70 | # define _Py_MEMORY_SANITIZER |
| 71 | # endif |
| 72 | # endif |
| 73 | #endif |
| 74 | |
| 75 | /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG. |
| 76 | * PYMALLOC_DEBUG is in error if pymalloc is not in use. |
| 77 | */ |
| 78 | #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG) |
| 79 | #define PYMALLOC_DEBUG |
| 80 | #endif |
| 81 | #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC) |
| 82 | #error "PYMALLOC_DEBUG requires WITH_PYMALLOC" |
| 83 | #endif |
| 84 | #include "pymath.h" |
| 85 | #include "pytime.h" |
| 86 | #include "pymem.h" |
| 87 | |
| 88 | #include "object.h" |
| 89 | #include "objimpl.h" |
| 90 | #include "typeslots.h" |
| 91 | #include "pyhash.h" |
| 92 | |
| 93 | #include "pydebug.h" |
| 94 | |
| 95 | #include "bytearrayobject.h" |
| 96 | #include "bytesobject.h" |
| 97 | #include "unicodeobject.h" |
| 98 | #include "longobject.h" |
| 99 | #include "longintrepr.h" |
| 100 | #include "boolobject.h" |
| 101 | #include "floatobject.h" |
| 102 | #include "complexobject.h" |
| 103 | #include "rangeobject.h" |
| 104 | #include "memoryobject.h" |
| 105 | #include "tupleobject.h" |
| 106 | #include "listobject.h" |
| 107 | #include "dictobject.h" |
| 108 | #include "odictobject.h" |
| 109 | #include "enumobject.h" |
| 110 | #include "setobject.h" |
| 111 | #include "methodobject.h" |
| 112 | #include "moduleobject.h" |
| 113 | #include "funcobject.h" |
| 114 | #include "classobject.h" |
| 115 | #include "fileobject.h" |
| 116 | #include "pycapsule.h" |
| 117 | #include "code.h" |
| 118 | #include "pyframe.h" |
| 119 | #include "traceback.h" |
| 120 | #include "sliceobject.h" |
| 121 | #include "cellobject.h" |
| 122 | #include "iterobject.h" |
| 123 | #include "genobject.h" |
| 124 | #include "descrobject.h" |
| 125 | #include "genericaliasobject.h" |
| 126 | #include "warnings.h" |
| 127 | #include "weakrefobject.h" |
| 128 | #include "structseq.h" |
| 129 | #include "namespaceobject.h" |
| 130 | #include "picklebufobject.h" |
| 131 | |
| 132 | #include "codecs.h" |
| 133 | #include "pyerrors.h" |
| 134 | |
| 135 | #include "cpython/initconfig.h" |
| 136 | #include "pythread.h" |
| 137 | #include "pystate.h" |
| 138 | #include "context.h" |
| 139 | |
| 140 | #include "pyarena.h" |
| 141 | #include "modsupport.h" |
| 142 | #include "compile.h" |
| 143 | #include "pythonrun.h" |
| 144 | #include "pylifecycle.h" |
| 145 | #include "ceval.h" |
| 146 | #include "sysmodule.h" |
| 147 | #include "osmodule.h" |
| 148 | #include "intrcheck.h" |
| 149 | #include "import.h" |
| 150 | |
| 151 | #include "abstract.h" |
| 152 | #include "bltinmodule.h" |
| 153 | |
| 154 | #include "eval.h" |
| 155 | |
| 156 | #include "pyctype.h" |
| 157 | #include "pystrtod.h" |
| 158 | #include "pystrcmp.h" |
| 159 | #include "fileutils.h" |
| 160 | #include "pyfpe.h" |
| 161 | #include "tracemalloc.h" |
| 162 | |
| 163 | #endif /* !Py_PYTHON_H */ |