Skip to content

Commit

Permalink
pythongh-100540: Remove unnecessary '-DMACOSX' for ctypes on macOS (p…
Browse files Browse the repository at this point in the history
…ythonGH-100542)

The define was only used to protect a `#pragma clang diagnostic`
setting, which is already better guarded by `__clang__` anwyay.
  • Loading branch information
zware committed Dec 28, 2022
1 parent 5e1adb4 commit fd4b55f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Modules/_ctypes/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
PyErr_Format(PyExc_NotImplementedError, "ffi_prep_closure_loc() is missing");
goto error;
#else
#if defined(__clang__) || defined(MACOSX)
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
Expand All @@ -436,7 +436,7 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
#endif
result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);

#if defined(__clang__) || defined(MACOSX)
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
Expand Down
2 changes: 1 addition & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3769,7 +3769,7 @@ AS_VAR_IF([have_libffi], [yes], [
AS_CASE([$ac_sys_system],
[Darwin], [
dnl when do we need USING_APPLE_OS_LIBFFI?
AS_VAR_APPEND([LIBFFI_CFLAGS], [" -I\$(srcdir)/Modules/_ctypes/darwin -DMACOSX"])
AS_VAR_APPEND([LIBFFI_CFLAGS], [" -I\$(srcdir)/Modules/_ctypes/darwin"])
ctypes_malloc_closure=yes
],
[sunos5], [AS_VAR_APPEND([LIBFFI_LIBS], [" -mimpure-text"])]
Expand Down

0 comments on commit fd4b55f

Please sign in to comment.