Skip to content

bpo-41617: Add _Py__has_builtin() macro#23260

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:py_has_builtin
Nov 13, 2020
Merged

bpo-41617: Add _Py__has_builtin() macro#23260
vstinner merged 1 commit into
python:masterfrom
vstinner:py_has_builtin

Conversation

@vstinner

@vstinner vstinner commented Nov 13, 2020

Copy link
Copy Markdown
Member

Fix building pycore_bitutils.h internal header on old clang version
without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7).

Add a new private _Py__has_builtin() macro to check for availability
of a preprocessor builtin function.

Co-Authored-By: Joshua Root jmr@macports.org

https://bugs.python.org/issue41617

Fix building pycore_bitutils.h internal header on old clang version
without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7).

Add a new private _Py__has_builtin() macro to check for availability
of a preprocessor builtin function.

Co-Authored-By: Joshua Root <jmr@macports.org>

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@corona10

corona10 commented Nov 13, 2020

Copy link
Copy Markdown
Member

Are you going to replace all of the __has_builtinlogic into the newly added macro with the sperate PRs?

@vstinner

Copy link
Copy Markdown
Member Author

Are you going to replace all of the __has_builtinlogic into the newly added macro with the sperate PRs?

I saw that __has_builtin() is used to support the new macOS version, but I don't plan to change this code. This code is new and fragile, and prefer to let someone else modifying it, but I don't think that it's worth it ;-) The practical issue is also that I cannot test such change on the new macOS.

@vstinner vstinner merged commit b3b9808 into python:master Nov 13, 2020
@vstinner vstinner deleted the py_has_builtin branch November 13, 2020 14:38
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @vstinner, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker b3b98082c5431e77c64cab2c85525a804436b505 3.9

@bedevere-bot

Copy link
Copy Markdown

GH-23262 is a backport of this pull request to the 3.9 branch.

vstinner added a commit that referenced this pull request Nov 13, 2020
Fix building pycore_bitutils.h internal header on old clang version
without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7).

Add a new private _Py__has_builtin() macro to check for availability
of a preprocessor builtin function.

Co-Authored-By: Joshua Root <jmr@macports.org>

Co-authored-by: Joshua Root <jmr@macports.org>
(cherry picked from commit b3b9808)
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Fix building pycore_bitutils.h internal header on old clang version
without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7).

Add a new private _Py__has_builtin() macro to check for availability
of a preprocessor builtin function.

Co-Authored-By: Joshua Root <jmr@macports.org>

Co-authored-by: Joshua Root <jmr@macports.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants