2022-08-17 08:48:43 -03:00
|
|
|
#ifndef Py_TESTCAPI_PARTS_H
|
|
|
|
#define Py_TESTCAPI_PARTS_H
|
|
|
|
|
|
|
|
#include "pyconfig.h" // for Py_TRACE_REFS
|
|
|
|
|
|
|
|
// Figure out if Limited API is available for this build. If it isn't we won't
|
|
|
|
// build tests for it.
|
|
|
|
// Currently, only Py_TRACE_REFS disables Limited API.
|
|
|
|
#ifdef Py_TRACE_REFS
|
|
|
|
#undef LIMITED_API_AVAILABLE
|
|
|
|
#else
|
|
|
|
#define LIMITED_API_AVAILABLE 1
|
|
|
|
#endif
|
2022-07-08 12:56:26 -03:00
|
|
|
|
2022-08-17 08:48:43 -03:00
|
|
|
// Always enable assertions
|
2022-08-10 06:53:10 -03:00
|
|
|
#undef NDEBUG
|
|
|
|
|
2022-08-17 08:48:43 -03:00
|
|
|
#if !defined(LIMITED_API_AVAILABLE) && defined(Py_LIMITED_API)
|
|
|
|
// Limited API being unavailable means that with Py_LIMITED_API defined
|
|
|
|
// we can't even include Python.h.
|
|
|
|
// Do nothing; the .c file that defined Py_LIMITED_API should also do nothing.
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#include "Python.h"
|
|
|
|
|
2022-07-13 08:22:45 -03:00
|
|
|
int _PyTestCapi_Init_Vectorcall(PyObject *module);
|
2022-08-01 10:04:14 -03:00
|
|
|
int _PyTestCapi_Init_Heaptype(PyObject *module);
|
2022-08-10 04:10:25 -03:00
|
|
|
int _PyTestCapi_Init_Unicode(PyObject *module);
|
2022-11-14 17:23:41 -04:00
|
|
|
int _PyTestCapi_Init_GetArgs(PyObject *module);
|
2022-11-15 03:17:52 -04:00
|
|
|
int _PyTestCapi_Init_PyTime(PyObject *module);
|
|
|
|
int _PyTestCapi_Init_DateTime(PyObject *module);
|
2022-11-16 09:09:10 -04:00
|
|
|
int _PyTestCapi_Init_Docstring(PyObject *module);
|
|
|
|
int _PyTestCapi_Init_Mem(PyObject *module);
|
2022-11-16 15:13:32 -04:00
|
|
|
int _PyTestCapi_Init_Watchers(PyObject *module);
|
2022-11-17 04:56:56 -04:00
|
|
|
int _PyTestCapi_Init_Long(PyObject *module);
|
|
|
|
int _PyTestCapi_Init_Float(PyObject *module);
|
gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014)
The ``structmember.h`` header is deprecated, though it continues to be available
and there are no plans to remove it. There are no deprecation warnings. Old code
can stay unchanged (unless the extra include and non-namespaced macros bother
you greatly). Specifically, no uses in CPython are updated -- that would just be
unnecessary churn.
The ``structmember.h`` header is deprecated, though it continues to be
available and there are no plans to remove it.
Its contents are now available just by including ``Python.h``,
with a ``Py`` prefix added if it was missing:
- `PyMemberDef`, `PyMember_GetOne` and`PyMember_SetOne`
- Type macros like `Py_T_INT`, `Py_T_DOUBLE`, etc.
(previously ``T_INT``, ``T_DOUBLE``, etc.)
- The flags `Py_READONLY` (previously ``READONLY``) and
`Py_AUDIT_READ` (previously all uppercase)
Several items are not exposed from ``Python.h``:
- `T_OBJECT` (use `Py_T_OBJECT_EX`)
- `T_NONE` (previously undocumented, and pretty quirky)
- The macro ``WRITE_RESTRICTED`` which does nothing.
- The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of
`Py_AUDIT_READ`.
- In some configurations, ``<stddef.h>`` is not included from ``Python.h``.
It should be included manually when using ``offsetof()``.
The deprecated header continues to provide its original
contents under the original names.
Your old code can stay unchanged, unless the extra include and non-namespaced
macros bother you greatly.
There is discussion on the issue to rename `T_PYSSIZET` to `PY_T_SSIZE` or
similar. I chose not to do that -- users will probably copy/paste that with any
spelling, and not renaming it makes migration docs simpler.
Co-Authored-By: Alexander Belopolsky <abalkin@users.noreply.github.com>
Co-Authored-By: Matthias Braun <MatzeB@users.noreply.github.com>
2022-11-22 03:25:43 -04:00
|
|
|
int _PyTestCapi_Init_Structmember(PyObject *module);
|
2023-02-23 11:03:13 -04:00
|
|
|
int _PyTestCapi_Init_Exceptions(PyObject *module);
|
2022-08-17 08:48:43 -03:00
|
|
|
|
|
|
|
#ifdef LIMITED_API_AVAILABLE
|
|
|
|
int _PyTestCapi_Init_VectorcallLimited(PyObject *module);
|
|
|
|
#endif // LIMITED_API_AVAILABLE
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif // Py_TESTCAPI_PARTS_H
|