Commit 6a0d23af by Jonathan Wakely Committed by Jonathan Wakely

Ensure "C++" language linkage for std::abs overloads

	PR libstdc++/77814
	* include/bits/std_abs.h: Use "C++" language linkage.
	* testsuite/17_intro/headers/c++2011/linkage.cc: Move <complex.h> to
	the end. Add <stdalign.h>.

From-SVN: r240710
parent 3fe2ddae
2016-10-03 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/77814
* include/bits/std_abs.h: Use "C++" language linkage.
* testsuite/17_intro/headers/c++2011/linkage.cc: Move <complex.h> to
the end. Add <stdalign.h>.
2016-10-03 Ville Voutilainen <ville.voutilainen@gmail.com> 2016-10-03 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/77802 PR libstdc++/77802
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#undef abs #undef abs
extern "C++"
{
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
...@@ -103,5 +105,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -103,5 +105,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
}
#endif // _GLIBCXX_BITS_STD_ABS_H #endif // _GLIBCXX_BITS_STD_ABS_H
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
extern "C" extern "C"
{ {
#include <assert.h> #include <assert.h>
#ifdef _GLIBCXX_HAVE_COMPLEX_H // See below for <complex.h>
#include <complex.h>
#endif
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#ifdef _GLIBCXX_HAVE_FENV_H #ifdef _GLIBCXX_HAVE_FENV_H
...@@ -43,6 +41,9 @@ extern "C" ...@@ -43,6 +41,9 @@ extern "C"
#include <math.h> #include <math.h>
#include <setjmp.h> #include <setjmp.h>
#include <signal.h> #include <signal.h>
#if _GLIBCXX_HAVE_STDALIGN_H
#include <stdalign.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#ifdef _GLIBCXX_HAVE_STDBOOL_H #ifdef _GLIBCXX_HAVE_STDBOOL_H
#include <stdbool.h> #include <stdbool.h>
...@@ -67,4 +68,10 @@ extern "C" ...@@ -67,4 +68,10 @@ extern "C"
#ifdef _GLIBCXX_HAVE_WCTYPE_H #ifdef _GLIBCXX_HAVE_WCTYPE_H
#include <wctype.h> #include <wctype.h>
#endif #endif
// Include this last, because it adds extern "C++" and so hides problems in
// other headers if included first (e.g. PR libstdc++/77814).
#ifdef _GLIBCXX_HAVE_COMPLEX_H
#include <complex.h>
#endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment