summaryrefslogtreecommitdiffstats
path: root/Lib/test/_testcppext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* gh-91321: Add _Py_NULL macro (#92253)Victor Stinner2022-05-031-4/+4
| | | | | | | | Fix C++ compiler warnings: "zero as null pointer constant" (clang -Wzero-as-null-pointer-constant). * Add the _Py_NULL macro used by static inline functions to use nullptr in C++. * Replace NULL with nullptr in _testcppext.cpp.
* gh-92135: Fix _Py_reinterpret_cast() for const (#92138)Victor Stinner2022-05-021-0/+31
| | | | | | | | | | Fix C++ compiler warnings on cast macros, like _PyObject_CAST(), when casting a constant expression to a non constant type: use const_cast<> in C++. * In C++, Py_SAFE_DOWNCAST() now uses static_cast<> rather than reinterpret_cast<>. * Add tests to the _testcppext C++ extension. * test_cppext no longer captures stdout in verbose mode.
* gh-91321: Add _testcppext C++ extension (#32175)Victor Stinner2022-05-021-0/+62
Build a basic C++ test extension to check that the Python C API is compatible with C++ and does not emit C++ compiler warnings. * Add Modules/_testcppext.cpp: C++ extension * Add Lib/test/test_cppext.py: test building the C++ extension.