Changeset 86623 in vbox for trunk/src/libs/xpcom18a4/python
- Timestamp:
- Oct 19, 2020 9:00:23 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 140997
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/python/src/PyXPCOM.h
r86333 r86623 138 138 # define PyInt_AsLong(o) PyLong_AsLong(o) 139 139 # define PyNumber_Int(o) PyNumber_Long(o) 140 # ifndef PyUnicode_AsUTF8 141 # define PyUnicode_AsUTF8(o) _PyUnicode_AsString(o) 142 # endif 143 # ifndef PyUnicode_AsUTF8AndSize 144 # define PyUnicode_AsUTF8AndSize(o,s) _PyUnicode_AsStringAndSize(o,s) 140 # if !defined(Py_LIMITED_API) && PY_VERSION_HEX <= 0x03030000 /* 3.3 added PyUnicode_AsUTF8AndSize */ 141 # ifndef PyUnicode_AsUTF8 142 # define PyUnicode_AsUTF8(o) _PyUnicode_AsString(o) 143 # endif 144 # ifndef PyUnicode_AsUTF8AndSize 145 # define PyUnicode_AsUTF8AndSize(o,s) _PyUnicode_AsStringAndSize(o,s) 146 # endif 145 147 # endif 146 148 typedef struct PyMethodChain … … 175 177 #else /* Py_LIMITED_API */ 176 178 179 # if PY_VERSION_HEX <= 0x03030000 180 # error "Py_LIMITED_API mode only works for Python 3.3 and higher." 181 # endif 182 177 183 const char *PyXPCOMGetObTypeName(PyTypeObject *pTypeObj); 178 184 # define PyXPCOM_ObTypeName(obj) PyXPCOMGetObTypeName(Py_TYPE(obj)) 179 185 180 /** @todo shouldn't be using PyUnicode_AsUTF8 from cpython/unicodeobject.h! */ 181 # undef PyUnicode_AsUTF8 182 extern "C" PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *); 183 184 /** @todo shouldn't be using PyUnicode_AsUTF8AndSize from cpython/unicodeobject.h! */ 185 # undef PyUnicode_AsUTF8AndSize 186 # if Py_LIMITED_API < 0x030A0000 187 /* Note! While we should not technically be using PyUnicode_AsUTF8AndSize, it was 188 made part of the limited API in 3.10 (see https://bugs.python.org/issue41784 and 189 https://github.com/python/cpython/commit/a05195ac61f1908ac5990cccb5aa82442bdaf15d). */ 186 190 extern "C" PyAPI_FUNC(const char *) PyUnicode_AsUTF8AndSize(PyObject *, Py_ssize_t *); 191 # endif 192 193 /* PyUnicode_AsUTF8 is just PyUnicode_AsUTF8AndSize without returning a size. */ 194 # define PyUnicode_AsUTF8(o) PyUnicode_AsUTF8AndSize(o, NULL) 187 195 188 196 DECLINLINE(int) PyRun_SimpleString(const char *pszCode)
Note:
See TracChangeset
for help on using the changeset viewer.