Commit eac437bf by Jonathan Wakely Committed by Jonathan Wakely

Ensure C++ language linkage in cmath and cstdlib

	PR libstdc++/69386
	* include/c_global/ccomplex: Ensure C++ language linkage.
	* include/c_global/cmath: Likewise.
	* include/c_global/cstdlib: Likewise.
	* include/c_global/ctgmath: Likewise.
	* testsuite/17_intro/headers/c++2011/linkage.cc: New.

From-SVN: r232607
parent 825da0d2
2016-01-20 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/69386
* include/c_global/ccomplex: Ensure C++ language linkage.
* include/c_global/cmath: Likewise.
* include/c_global/cstdlib: Likewise.
* include/c_global/ctgmath: Likewise.
* testsuite/17_intro/headers/c++2011/linkage.cc: New.
2016-01-19 Jonathan Wakely <jwakely@redhat.com> 2016-01-19 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/14608 PR libstdc++/14608
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
# include <bits/c++0x_warning.h> # include <bits/c++0x_warning.h>
#endif #endif
extern "C++" {
#include <complex> #include <complex>
}
#endif #endif
...@@ -74,6 +74,8 @@ ...@@ -74,6 +74,8 @@
#undef tan #undef tan
#undef tanh #undef tanh
extern "C++"
{
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
...@@ -1790,4 +1792,6 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -1790,4 +1792,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
# include <bits/specfun.h> # include <bits/specfun.h>
#endif #endif
} // extern "C++"
#endif #endif
...@@ -115,6 +115,8 @@ namespace std ...@@ -115,6 +115,8 @@ namespace std
#undef wcstombs #undef wcstombs
#undef wctomb #undef wctomb
extern "C++"
{
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
...@@ -272,6 +274,8 @@ namespace std ...@@ -272,6 +274,8 @@ namespace std
#endif // _GLIBCXX_USE_C99_STDLIB #endif // _GLIBCXX_USE_C99_STDLIB
} // extern "C++"
#endif // !_GLIBCXX_HOSTED #endif // !_GLIBCXX_HOSTED
#endif #endif
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
# include <bits/c++0x_warning.h> # include <bits/c++0x_warning.h>
#else #else
# include <cmath> # include <cmath>
extern "C++" {
# include <complex> # include <complex>
}
#endif #endif
#endif #endif
......
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++11" }
// { dg-do compile }
// libstdc++/69386
extern "C"
{
#include <assert.h>
#include <complex.h>
#include <ctype.h>
#include <errno.h>
#include <fenv.h>
#include <float.h>
#include <inttypes.h>
#include <iso646.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tgmath.h>
#include <time.h>
#include <uchar.h>
#include <wchar.h>
#include <wctype.h>
}
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