Skip to content

Commit

Permalink
bpo-11566: Extension build errors on Windows for _hypot (pythonGH-11283)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
thewtex authored and miss-islington committed Dec 22, 2018
1 parent 97d9d90 commit a336a94
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions PC/pyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ typedef int pid_t;
#define Py_IS_FINITE(X) _finite(X)
#define copysign _copysign

/* VS 2010 and above already defines hypot as _hypot */
#if _MSC_VER < 1600
#define hypot _hypot
#endif

/* VS 2015 defines these names with a leading underscore */
#if _MSC_VER >= 1900
#define timezone _timezone
Expand Down Expand Up @@ -231,7 +226,6 @@ typedef int pid_t;
#endif

#define COMPILER "[gcc]"
#define hypot _hypot
#define PY_LONG_LONG long long
#define PY_LLONG_MIN LLONG_MIN
#define PY_LLONG_MAX LLONG_MAX
Expand Down

0 comments on commit a336a94

Please sign in to comment.