File indexing completed on 2025-01-18 09:50:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifdef _DEBUG
0024 # ifndef BOOST_DEBUG_PYTHON
0025 # ifdef _MSC_VER
0026
0027
0028
0029 # include <stddef.h>
0030 # include <stdarg.h>
0031 # include <stdio.h>
0032 # include <stdlib.h>
0033 # include <assert.h>
0034 # include <errno.h>
0035 # include <ctype.h>
0036 # include <wchar.h>
0037 # include <basetsd.h>
0038 # include <io.h>
0039 # include <limits.h>
0040 # include <float.h>
0041 # include <string.h>
0042 # include <math.h>
0043 # include <time.h>
0044 # endif
0045 # undef _DEBUG
0046 # define DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
0047 # endif
0048 #endif
0049
0050
0051
0052 #if defined(__MINGW32__)
0053 # include <cmath>
0054 # include <math.h>
0055 #endif
0056
0057 # include <pyconfig.h>
0058 # if defined(_SGI_COMPILER_VERSION) && _SGI_COMPILER_VERSION >= 740
0059 # undef _POSIX_C_SOURCE
0060 # undef _XOPEN_SOURCE
0061 # undef HAVE_STDINT_H
0062 # endif
0063
0064
0065
0066
0067
0068 #include <limits.h>
0069 #ifndef ULONG_MAX
0070 # define BOOST_PYTHON_ULONG_MAX_UNDEFINED
0071 #endif
0072 #ifndef LONGLONG_MAX
0073 # define BOOST_PYTHON_LONGLONG_MAX_UNDEFINED
0074 #endif
0075 #ifndef ULONGLONG_MAX
0076 # define BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED
0077 #endif
0078
0079
0080
0081
0082 #include <patchlevel.h>
0083
0084 #if PY_MAJOR_VERSION<2 || PY_MAJOR_VERSION==2 && PY_MINOR_VERSION<2
0085 #error Python 2.2 or higher is required for this version of Boost.Python.
0086 #endif
0087
0088
0089
0090
0091
0092 #if defined(_WIN32) || defined(__CYGWIN__)
0093
0094 # if defined(__GNUC__) && defined(__CYGWIN__)
0095
0096 # if defined(__LP64__)
0097 # define SIZEOF_LONG 8
0098 # else
0099 # define SIZEOF_LONG 4
0100 # endif
0101
0102
0103 # if PY_MAJOR_VERSION < 2 || PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 2
0104
0105 typedef int pid_t;
0106
0107 # if defined(__LP64__)
0108 # define WORD_BIT 64
0109 # else
0110 # define WORD_BIT 32
0111 # endif
0112 # define hypot _hypot
0113 # include <stdio.h>
0114
0115 # if PY_MAJOR_VERSION < 2
0116 # define HAVE_CLOCK
0117 # define HAVE_STRFTIME
0118 # define HAVE_STRERROR
0119 # endif
0120
0121 # define NT_THREADS
0122
0123 # ifndef NETSCAPE_PI
0124 # define USE_SOCKET
0125 # endif
0126
0127 # ifdef USE_DL_IMPORT
0128 # define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
0129 # endif
0130
0131 # ifdef USE_DL_EXPORT
0132 # define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
0133 # define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
0134 # endif
0135
0136 # define HAVE_LONG_LONG 1
0137 # define LONG_LONG long long
0138 # endif
0139
0140 # elif defined(__MWERKS__)
0141
0142 # ifndef _MSC_VER
0143 # define PY_MSC_VER_DEFINED_FROM_WRAP_PYTHON_H 1
0144 # define _MSC_VER 900
0145 # endif
0146
0147 # undef hypot
0148
0149 # elif defined(__BORLANDC__) && !defined(__clang__)
0150 # undef HAVE_HYPOT
0151 # define HAVE_HYPOT 1
0152 # endif
0153
0154 #endif
0155
0156 #if defined(__GNUC__)
0157 # if defined(__has_warning)
0158 # define BOOST_PYTHON_GCC_HAS_WREGISTER __has_warning("-Wregister")
0159 # else
0160 # define BOOST_PYTHON_GCC_HAS_WREGISTER __GNUC__ >= 7
0161 # endif
0162 #else
0163 # define BOOST_PYTHON_GCC_HAS_WREGISTER 0
0164 #endif
0165
0166
0167 #if BOOST_PYTHON_GCC_HAS_WREGISTER
0168 # pragma GCC diagnostic push
0169 # pragma GCC diagnostic ignored "-Wregister"
0170 #elif defined(_MSC_VER)
0171 # pragma warning(push)
0172 # pragma warning(disable : 5033)
0173 #endif
0174
0175 #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION == 2 && PY_MICRO_VERSION < 2
0176 # include <boost/python/detail/python22_fixed.h>
0177 #else
0178 # include <Python.h>
0179 #endif
0180
0181 #if BOOST_PYTHON_GCC_HAS_WREGISTER
0182 # pragma GCC diagnostic pop
0183 #elif defined(_MSC_VER)
0184 # pragma warning(pop)
0185 #endif
0186 #undef BOOST_PYTHON_GCC_HAS_WREGISTER
0187
0188 #ifdef BOOST_PYTHON_ULONG_MAX_UNDEFINED
0189 # undef ULONG_MAX
0190 # undef BOOST_PYTHON_ULONG_MAX_UNDEFINED
0191 #endif
0192
0193 #ifdef BOOST_PYTHON_LONGLONG_MAX_UNDEFINED
0194 # undef LONGLONG_MAX
0195 # undef BOOST_PYTHON_LONGLONG_MAX_UNDEFINED
0196 #endif
0197
0198 #ifdef BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED
0199 # undef ULONGLONG_MAX
0200 # undef BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED
0201 #endif
0202
0203 #ifdef PY_MSC_VER_DEFINED_FROM_WRAP_PYTHON_H
0204 # undef _MSC_VER
0205 #endif
0206
0207 #ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
0208 # undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
0209 # define _DEBUG
0210 # ifdef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
0211 # undef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
0212 # undef _CRT_NOFORCE_MANIFEST
0213 # endif
0214 #endif
0215
0216 #if !defined(PY_MAJOR_VERSION) || PY_MAJOR_VERSION < 2
0217 # define PyObject_INIT(op, typeobj) \
0218 ( (op)->ob_type = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
0219 #endif
0220
0221
0222 #if PY_VERSION_HEX < 0x02060000
0223
0224 # define Py_TYPE(o) (((PyObject*)(o))->ob_type)
0225 # define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt)
0226 # define Py_SIZE(o) (((PyVarObject*)(o))->ob_size)
0227
0228 # define PyVarObject_HEAD_INIT(type, size) \
0229 PyObject_HEAD_INIT(type) size,
0230 #endif
0231
0232 #if PY_VERSION_HEX < 0x030900A4
0233 # define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0)
0234 # define Py_SET_SIZE(obj, size) ((Py_SIZE(obj) = (size)), (void)0)
0235 #endif
0236
0237
0238 #ifdef __MWERKS__
0239 # pragma warn_possunwant off
0240 #elif _MSC_VER
0241 # pragma warning(disable:4786)
0242 #endif
0243
0244 #if defined(HAVE_LONG_LONG)
0245 # if defined(PY_LONG_LONG)
0246 # define BOOST_PYTHON_LONG_LONG PY_LONG_LONG
0247 # elif defined(LONG_LONG)
0248 # define BOOST_PYTHON_LONG_LONG LONG_LONG
0249 # else
0250 # error "HAVE_LONG_LONG defined but not PY_LONG_LONG or LONG_LONG"
0251 # endif
0252 #endif