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 N
Neil Schemenauer committed
8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518
Parent: 3d647e7
Committed by GitHub <noreply@github.com>
on 6/5/2022, 1:49:39 AM