-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-128156: Guard use of ffi_type_complex_double
on macOS system libffi
#128680
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but we need some feedback from MacOS experts.
TABLE_ENTRY(C, &ffi_type_complex_double); | ||
TABLE_ENTRY(E, &ffi_type_complex_float); | ||
TABLE_ENTRY(F, &ffi_type_complex_longdouble); | ||
if (Py_FFI_COMPLEX_AVAILABLE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you rather should move all runtime logic for Py_FFI_COMPLEX_AVAILABLE
to this place, together with a comment why (and when) we need this. And when it might be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to imply that this needs to be the only place that uses the runtime check.
IMO, the __builtin_available(macOS 10.15, *)
already indicates that it can be removed when we drop macOS 10.14 and lower.
formattable.fmt{C,E,F}
now have a runtime guard (ifUSING_APPLE_OS_LIBFFI
).The list of type codes (previously
SIMPLE_TYPE_CHARS
) is now generated at runtime.ffi_type_complex_double
is unguarded #128156📚 Documentation preview 📚: https://cpython-previews--128680.org.readthedocs.build/