PR libstdc++/85729 add linkage specifications to headers
authorJonathan Wakely <jwakely@redhat.com>
Thu, 10 May 2018 12:35:45 +0000 (13:35 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 10 May 2018 12:35:45 +0000 (13:35 +0100)
PR libstdc++/85729
* include/bits/c++config.h (__replacement_assert): Add linkage
specification.
* include/bits/std_abs.h: Add comment to closing brace of block.
* include/c_global/cstddef: Add linkage specification.
* include/c_global/cstring: Likewise.
* include/c_global/cwchar: Likewise.

From-SVN: r260114

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/c++config
libstdc++-v3/include/bits/std_abs.h
libstdc++-v3/include/c_global/cstddef
libstdc++-v3/include/c_global/cstring
libstdc++-v3/include/c_global/cwchar

index 2416cdca9e57c49738c7fe823339bdbb97ed256d..53d84b09b3a12ad3a70db1ac29bff0c17e33c13e 100644 (file)
@@ -1,3 +1,13 @@
+2018-05-10  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/85729
+       * include/bits/c++config.h (__replacement_assert): Add linkage
+       specification.
+       * include/bits/std_abs.h: Add comment to closing brace of block.
+       * include/c_global/cstddef: Add linkage specification.
+       * include/c_global/cstring: Likewise.
+       * include/c_global/cwchar: Likewise.
+
 2018-05-09  François Dumont  <fdumont@gcc.gnu.org>
 
        * include/debug/safe_iterator.h (_Safe_iterator<>::_M_constant()):
index bfe268da825090dec334224aafec0b9d646b9a7b..280f65e1ba0a4d1f1f8d462f499c47969a52ce53 100644 (file)
@@ -438,7 +438,7 @@ namespace std
 {
   // Avoid the use of assert, because we're trying to keep the <cassert>
   // include out of the mix.
-  inline void
+  extern "C++" inline void
   __replacement_assert(const char* __file, int __line,
                       const char* __function, const char* __condition)
   {
index 6e4551d6597e85a86844148a605372127e6e795e..bcea4f492035d2480d01cc7f5b8eabfd82a512c4 100644 (file)
@@ -105,6 +105,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
-}
+} // extern "C"++"
 
 #endif // _GLIBCXX_BITS_STD_ABS_H
index 36d7d716cc38a0bff6ee0e02758a14f8fe63d577..0ca3b82338ad0d841eb6012477ea6a093a21b925 100644 (file)
 #include <bits/c++config.h>
 #include <stddef.h>
 
+extern "C++"
+{
 #if __cplusplus >= 201103L
 namespace std
 {
   // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h.
   using ::max_align_t;
 }
-#endif
+#endif // C++11
 
 #if __cplusplus >= 201703L
 namespace std
@@ -186,6 +188,7 @@ namespace std
     { return _IntegerType(__b); }
 
 } // namespace std
-#endif
+#endif // C++17
+} // extern "C++"
 
 #endif // _GLIBCXX_CSTDDEF
index 399f41fb164ae7daa9b2c555a6a722a5f748b551..2bca01b7f085363497e3cdda15f44bbc82d34d35 100644 (file)
@@ -68,6 +68,8 @@
 #undef strtok
 #undef strxfrm
 
+extern "C++"
+{
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -119,5 +121,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
+} // extern "C++"
 
 #endif
index 475322ee806a5ea5bf8cc59a69b72d45f7c8df8d..7557c7768aa09b1a224574670723172991ab0771 100644 (file)
@@ -132,6 +132,8 @@ namespace std
 
 #if _GLIBCXX_USE_WCHAR_T
 
+extern "C++"
+{
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -231,6 +233,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
+} // extern "C++"
 
 #if _GLIBCXX_USE_C99_WCHAR