Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-11566: Remove hypot -> _hypot macro for very old compilers #11283

Merged

Conversation

thewtex
Copy link
Contributor

@thewtex thewtex commented Dec 22, 2018

This addresses C extension build errors related to an undefined _hypot
symbol when building with the Microsoft Visual C++ Compiler for Python
2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++
extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not
been declared'

On line 71 of PC/pyconfig.h, HAVE_HYPOT is defined, indicating that
hypot is expected to be available in current Windows toolchains.

[1] https://www.microsoft.com/en-us/download/details.aspx?id=44266

[2] https://mingwpy.github.io/

https://bugs.python.org/issue11566

This addresses C extension build errors related to an undefined _hypot
symbol when building with the Microsoft Visual C++ Compiler for Python
2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++
extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not
been declared'

On line 71 of PC/pyconfig.h, HAVE_HYPOT is defined, indicating that
hypot is expected to be available in current Windows toolchains.

[1] https://www.microsoft.com/en-us/download/details.aspx?id=44266

[2] https://mingwpy.github.io/
@thewtex thewtex requested a review from a team as a code owner December 22, 2018 00:52
@methane methane changed the title bpo-11566: Extension build errors on Windows for _hypot bpo-11566: Remove _hypot -> hypot alias for very old compilers Dec 22, 2018
@methane methane changed the title bpo-11566: Remove _hypot -> hypot alias for very old compilers bpo-11566: Remove hypot -> _hypot macro for very old compilers Dec 22, 2018
@methane methane added type-bug An unexpected behavior, bug, or error needs backport to 2.7 OS-windows skip news labels Dec 22, 2018
@methane methane merged commit 87667c5 into python:master Dec 22, 2018
@miss-islington
Copy link
Contributor

Thanks @thewtex for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.7.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-11284 is a backport of this pull request to the 3.7 branch.

@miss-islington
Copy link
Contributor

Sorry, @thewtex and @methane, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 87667c54c6650751c5d7bf7b9e465c8c4af45f71 2.7

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 22, 2018
This addresses C extension build errors related to an undefined _hypot
symbol when building with the Microsoft Visual C++ Compiler for Python
2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++
extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not
been declared'

[1] https://www.microsoft.com/en-us/download/details.aspx?id=44266
[2] https://mingwpy.github.io/
(cherry picked from commit 87667c5)

Co-authored-by: Matt McCormick <matt@mmmccormick.com>
methane pushed a commit that referenced this pull request Dec 22, 2018
)

This addresses C extension build errors related to an undefined _hypot
symbol when building with the Microsoft Visual C++ Compiler for Python
2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++
extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not
been declared'

[1] https://www.microsoft.com/en-us/download/details.aspx?id=44266
[2] https://mingwpy.github.io/
miss-islington added a commit that referenced this pull request Dec 22, 2018
This addresses C extension build errors related to an undefined _hypot
symbol when building with the Microsoft Visual C++ Compiler for Python
2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++
extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not
been declared'

[1] https://www.microsoft.com/en-us/download/details.aspx?id=44266
[2] https://mingwpy.github.io/
(cherry picked from commit 87667c5)

Co-authored-by: Matt McCormick <matt@mmmccormick.com>
@thewtex
Copy link
Contributor Author

thewtex commented Dec 22, 2018

@miss-islington thanks for the help! The Python 2.7 patch is at GH-880 and has been merged by @methane. 🌮 🎉 🕺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants