gh-128156: Guard use of ffi_type_complex_double on macOS system libffi#128680
gh-128156: Guard use of ffi_type_complex_double on macOS system libffi#128680encukou merged 8 commits intopython:mainfrom
ffi_type_complex_double on macOS system libffi#128680Conversation
skirpichev
left a comment
There was a problem hiding this comment.
Looks good, but we need some feedback from MacOS experts.
|
cc: @ronaldoussoren @python/macos-team |
ned-deily
left a comment
There was a problem hiding this comment.
LGTM. I verified that with the PR we could now build and install cpython on the current macOS 15.2 using MACOSX_DEPLOYMENT_TARGET=10.14 and then also install and execute the same binaries on a macOS 10.14.x system. As expected, on 15.2 the three complex types were available and on 10.14, they were not. And test_ctypes ran without errors on both systems. Nice work, @encukou !
|
Thank you for the thorough review! |
|
Not sure if it's my system or not but I'm unable to compile :( Other uses of I'm using OpenSUSE and gcc 7.5 |
|
I think we should do the following: This is also what's recommended by https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fbuiltin.html. |
|
Isn't `#if defined(__has_builtin)` equivalent to `#ifdef __has_builtin`?
|
|
Yes, but somehow this doesn't work so I don't know :( (I'll check tomorrow again but the current code doesn't compile on my side) |
|
I'd be interested to know what compiler, OS and configure settings you're using. |
|
I'm using gcc 7.5.0, my OS is openSUSE 15.5 and I used |
|
See #129141 for the relevant issue. |
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_doubleis unguarded #128156📚 Documentation preview 📚: https://cpython-previews--128680.org.readthedocs.build/