cpython: daa1ab27b5c2 (original) (raw)
--- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -65,6 +65,45 @@ test_config(PyObject self) } static PyObject +test_sizeof_c_types(PyObject *self) +{ +#define CHECK_SIZEOF(EXPECTED, TYPE) [](#l1.9)
- if (EXPECTED != sizeof(TYPE)) { [](#l1.10)
PyErr_Format(TestError, \[](#l1.11)
"sizeof(%s) = %u instead of %u", \[](#l1.12)
#TYPE, sizeof(TYPE), EXPECTED); \[](#l1.13)
return (PyObject*)NULL; \[](#l1.14)
- }
- /* pointer/size types */
- CHECK_SIZEOF(sizeof(void *), size_t);
- CHECK_SIZEOF(sizeof(void *), Py_ssize_t);
+ +#undef CHECK_SIZEOF +} + + +static PyObject* test_list_api(PyObject self) { PyObject list; @@ -2783,6 +2822,7 @@ static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, {"raise_memoryerror", (PyCFunction)raise_memoryerror, METH_NOARGS}, {"test_config", (PyCFunction)test_config, METH_NOARGS},