Skip to content

gh-157695: Rename HAVE_ACOSPI to _Py_HAVE_ACOSPI - #157858

Merged
vstinner merged 3 commits into
python:mainfrom
vstinner:rename_have_acospi
Sep 22, 2026
Merged

vstinner merged 3 commits into
python:mainfrom
vstinner:rename_have_acospi

Conversation

@vstinner

@vstinner vstinner commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

configure.ac: Add PY_CHECK_FUNC_PRIVATE() function, similar to PY_CHECK_FUNC() but defines macro _Py_HAVE_xxx instead of HAVE_xxx.

Use PY_CHECK_FUNC_PRIVATE() for functions: acospi, asinpi, atanpi, atan2pi, cospi, sinpi and tanpi.

configure.ac: Add PY_CHECK_FUNC_PRIVATE() function, similar to
PY_CHECK_FUNC() but defines macro _Py_HAVE_xxx instead of HAVE_xxx.

Use PY_CHECK_FUNC_PRIVATE() for functions: acospi, asinpi, atanpi,
atan2pi, cospi, sinpi and tanpi.
@skirpichev

Copy link
Copy Markdown
Member

@vstinner, do you suggest to rename all macros, coming from standard configure tests like AC_CHECK_FUNCS_ONCE()?

I don't think that they pose some problems for programs, including Python.h: if people rely on configure macros - they should include own config.h after Python.h, that's all.

@vstinner

Copy link
Copy Markdown
Member Author

My proposition in issue #157695 is to no longer add macros with a name which doesn't start with Py to the Python C API. So new macros must start with Py.

@vstinner
vstinner enabled auto-merge (squash) September 22, 2026 05:45
@vstinner
vstinner merged commit a321390 into python:main Sep 22, 2026
53 checks passed
@vstinner
vstinner deleted the rename_have_acospi branch September 22, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants