Skip to content

gh-162214: Use #ifdef to test USING_APPLE_OS_LIBFFI macro in ctypes.h - #162221

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:wundef_ctypes
Nov 18, 2026
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:wundef_ctypes

Conversation

@vstinner

@vstinner vstinner commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

The macro is already tested by "#if defined(USING_APPLE_OS_LIBFFI)" in other ctypes C and header files.

…ypes.h

The macro is already tested by "#if defined(USING_APPLE_OS_LIBFFI)"
in other ctypes C and header files.
@vstinner

Copy link
Copy Markdown
Member Author

The macro is defined by configure.ac using -DUSING_APPLE_OS_LIBFFI=1 compiler flag.

Other C files already check for #ifdef USING_APPLE_OS_LIBFFI:

Modules/_ctypes/callbacks.c:#   ifdef USING_APPLE_OS_LIBFFI
Modules/_ctypes/callbacks.c:#if defined(USING_APPLE_OS_LIBFFI) && defined(__arm64__)

Modules/_ctypes/callproc.c:#   ifdef USING_APPLE_OS_LIBFFI

Modules/_ctypes/malloc_closure.c:#ifdef USING_APPLE_OS_LIBFFI
Modules/_ctypes/malloc_closure.c:#ifdef USING_APPLE_OS_LIBFFI
Modules/_ctypes/malloc_closure.c:#ifdef USING_APPLE_OS_LIBFFI
Modules/_ctypes/malloc_closure.c:#ifdef USING_APPLE_OS_LIBFFI

Only Modules/_ctypes/ctypes.h check for #if USING_APPLE_OS_LIBFFI:

Modules/_ctypes/ctypes.h:#   if USING_APPLE_OS_LIBFFI && defined(__has_builtin)

@vstinner
vstinner merged commit d7d41e2 into python:main Nov 18, 2026
58 checks passed
@vstinner
vstinner deleted the wundef_ctypes branch November 18, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant