Workaround for Python gcc MingGW WIN32 hypot declaration error
Fixes:
In file included from C:/msys64/mingw32/include/c++/7.3.0/math.h:36:0,
from C:/Python27/include/pyport.h:325,
from C:/Python27/include/Python.h:61,
from example_wrap.cxx:174:
C:/msys64/mingw32/include/c++/7.3.0/cmath:1136:11: error: '::hypot' has not been declared
using ::hypot;
^~~~~
See https://stackoverflow.com/questions/28683358/error-hypot-has-not-been-declared-in-cmath-while-trying-to-embed-python/28683412 and https://bugs.python.org/issue11566
This commit is contained in:
parent
abb2a9259c
commit
c7363fd95e
1 changed files with 5 additions and 0 deletions
|
|
@ -1,4 +1,9 @@
|
|||
%insert(runtime) %{
|
||||
#if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
|
||||
/* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
|
||||
# include <math.h>
|
||||
#endif
|
||||
|
||||
#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
|
||||
/* Use debug wrappers with the Python release dll */
|
||||
# undef _DEBUG
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue