aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2018-01-27 18:34:46 +0200
committerEli Zaretskii <eliz@gnu.org>2018-01-27 18:40:04 +0200
commit0b2b72156eef6e1a34f316e96278bc286f0d0506 (patch)
treee64fb1239eac2cd772b47954c4b9689cf0e51dfe
parent3d721be4ac8c6c8452c25aa382d09bd487dcded3 (diff)
downloadgdb-0b2b72156eef6e1a34f316e96278bc286f0d0506.zip
gdb-0b2b72156eef6e1a34f316e96278bc286f0d0506.tar.gz
gdb-0b2b72156eef6e1a34f316e96278bc286f0d0506.tar.bz2
Avoid compilation errors in MinGW native builds of GDB
The error is triggered by including python-internal.h, and the error message is: In file included from d:\usr\lib\gcc\mingw32\6.3.0\include\c++\math.h:36:0, from build-gnulib/import/math.h:27, from d:/usr/Python26/include/pyport.h:235, from d:/usr/Python26/include/Python.h:58, from python/python-internal.h:94, from python/py-arch.c:24: d:\usr\lib\gcc\mingw32\6.3.0\include\c++\cmath:1157:11: error: '::hypot' has not been declared using ::hypot; ^~~~~ This happens because Python headers define 'hypot' to expand to '_hypot' in the Windows builds. gdb/ChangeLog: 2018-01-27 Eli Zaretskii <eliz@gnu.org> * python/python-internal.h (_hypot) [__MINGW32__]: Define back to 'hypoth'. This avoids a compilation error. (cherry picked from commit b2a426e2c5632644b6b8bc0dde4cd32d42d548e2)
-rw-r--r--gdb/ChangeLog22
-rw-r--r--gdb/python/python-internal.h6
2 files changed, 28 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 21b086c..6d97419 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,25 @@
+2018-01-27 Eli Zaretskii <eliz@gnu.org>
+
+ Avoid compilation errors in MinGW native builds
+
+ The error is triggered by including python-internal.h, and the
+ error message is:
+
+ In file included from d:\usr\lib\gcc\mingw32\6.3.0\include\c++\math.h:36:0,
+ from build-gnulib/import/math.h:27,
+ from d:/usr/Python26/include/pyport.h:235,
+ from d:/usr/Python26/include/Python.h:58,
+ from python/python-internal.h:94,
+ from python/py-arch.c:24:
+ d:\usr\lib\gcc\mingw32\6.3.0\include\c++\cmath:1157:11: error: '::hypot' has not been declared
+ using ::hypot;
+ ^~~~~
+
+ This happens because Python headers define 'hypot' to expand t
+ '_hypot' in the Windows builds.
+ * python/python-internal.h (_hypot) [__MINGW32__]: Define back to
+ 'hypoth'. This avoids a compilation error.
+
2018-01-24 Pedro Alves <palves@redhat.com>
GCC PR libstdc++/83906
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index f32a258..c110588 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -85,6 +85,12 @@
#define HAVE_SNPRINTF 1
#endif
+/* Another kludge to avoid compilation errors because MinGW defines
+ 'hypot' to '_hypot', but the C++ headers says "using ::hypot". */
+#ifdef __MINGW32__
+# define _hypot hypot
+#endif
+
/* Request clean size types from Python. */
#define PY_SSIZE_T_CLEAN