diff options
author | Neil Schemenauer <nas-github@arctrix.com> | 2022-06-05 01:49:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-05 01:49:39 (GMT) |
commit | 8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518 (patch) | |
tree | cd378fd5df0961d632fe18e195474404b3471d53 /Misc | |
parent | 3d647e70cf4fd0e7cef68ed6662de3cb2cb0d63d (diff) | |
download | cpython-8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518.zip cpython-8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518.tar.gz cpython-8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518.tar.bz2 |
gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (#93500)
Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow
C++ extensions that pass 0 or NULL to macros using _Py_CAST() to
continue to compile. Without this, you get an error like:
invalid ‘static_cast’ from type ‘int’ to type ‘_object*’
The modern way to use a NULL value in C++ is to use nullptr. However,
we want to not break extensions that do things the old way.
Co-authored-by: serge-sans-paille
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/C API/2022-06-04-13-15-41.gh-issue-93442.4M4NDb.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2022-06-04-13-15-41.gh-issue-93442.4M4NDb.rst b/Misc/NEWS.d/next/C API/2022-06-04-13-15-41.gh-issue-93442.4M4NDb.rst new file mode 100644 index 0000000..f48ed37 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2022-06-04-13-15-41.gh-issue-93442.4M4NDb.rst @@ -0,0 +1,3 @@ +Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow C++ +extensions that pass 0 or NULL to macros using _Py_CAST() to continue to +compile. |