From 0621a279adfb981ea1f0564e7fc8280cda78e043 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Fri, 25 Jun 2010 16:53:37 -0700 Subject: [PATCH] libstdc++: use extern "C++" in all our C++ system headers. This is needed to build an independent toolchain with g++ that doesn't think that all these headers are in C. Change-Id: Ie9a8ccfcab7780d6a4e5722777d61c2b1b312001 --- libstdc++/include/cctype | 4 ++++ libstdc++/include/cmath | 4 ++++ libstdc++/include/csetjmp | 4 ++++ libstdc++/include/csignal | 4 ++++ libstdc++/include/cstddef | 4 ++++ libstdc++/include/cstdio | 4 ++++ libstdc++/include/cstdlib | 4 ++++ libstdc++/include/cstring | 4 ++++ libstdc++/include/ctime | 4 ++++ libstdc++/include/new | 4 ++++ libstdc++/include/typeinfo | 3 +++ 11 files changed, 43 insertions(+) diff --git a/libstdc++/include/cctype b/libstdc++/include/cctype index e23656142..e0eb98128 100644 --- a/libstdc++/include/cctype +++ b/libstdc++/include/cctype @@ -36,6 +36,8 @@ #include +extern "C++" { + namespace std { using ::isalnum; @@ -53,4 +55,6 @@ using ::tolower; using ::toupper; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CCTYPE__ diff --git a/libstdc++/include/cmath b/libstdc++/include/cmath index bf697ffa6..be7034389 100644 --- a/libstdc++/include/cmath +++ b/libstdc++/include/cmath @@ -37,6 +37,8 @@ #include #include +extern "C++" { + namespace std { // Functions. @@ -68,4 +70,6 @@ using ::floor; using ::fmod; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CMATH__ diff --git a/libstdc++/include/csetjmp b/libstdc++/include/csetjmp index a68d127b6..ba82144c3 100644 --- a/libstdc++/include/csetjmp +++ b/libstdc++/include/csetjmp @@ -36,6 +36,8 @@ #include +extern "C++" { + #ifndef setjmp #define setjmp(env) setjmp (env) #endif @@ -46,4 +48,6 @@ using ::jmp_buf; using ::longjmp; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CSETJMP__ diff --git a/libstdc++/include/csignal b/libstdc++/include/csignal index 2600a7505..84f0e1d02 100644 --- a/libstdc++/include/csignal +++ b/libstdc++/include/csignal @@ -36,6 +36,8 @@ #include +extern "C++" { + namespace std { using ::sig_atomic_t; @@ -43,4 +45,6 @@ using ::signal; using ::raise; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CSIGNAL__ diff --git a/libstdc++/include/cstddef b/libstdc++/include/cstddef index fc1ca9d6b..cb06b49c8 100644 --- a/libstdc++/include/cstddef +++ b/libstdc++/include/cstddef @@ -38,9 +38,13 @@ */ #include +extern "C++" { + namespace std { using ::ptrdiff_t; using ::size_t; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CSTDDEF__ diff --git a/libstdc++/include/cstdio b/libstdc++/include/cstdio index d46a18b43..3c8b5c62f 100644 --- a/libstdc++/include/cstdio +++ b/libstdc++/include/cstdio @@ -36,6 +36,8 @@ #include #include +extern "C++" { + namespace std { using ::FILE; using ::fpos_t; @@ -89,4 +91,6 @@ using ::vsnprintf; using ::vsscanf; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CSTDIO__ diff --git a/libstdc++/include/cstdlib b/libstdc++/include/cstdlib index 5e6a0b37a..e520543d1 100644 --- a/libstdc++/include/cstdlib +++ b/libstdc++/include/cstdlib @@ -35,6 +35,8 @@ */ #include +extern "C++" { + namespace std { using ::exit; @@ -110,4 +112,6 @@ using ::wctomb; using ::wcstombs; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CSTDLIB__ diff --git a/libstdc++/include/cstring b/libstdc++/include/cstring index 80473ccdb..d3d9387e3 100644 --- a/libstdc++/include/cstring +++ b/libstdc++/include/cstring @@ -37,6 +37,8 @@ #include #include +extern "C++" { + namespace std { using ::memchr; @@ -63,4 +65,6 @@ using ::strtok; using ::strxfrm; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CSTRING__ diff --git a/libstdc++/include/ctime b/libstdc++/include/ctime index 36fe7d594..9e6744fe4 100644 --- a/libstdc++/include/ctime +++ b/libstdc++/include/ctime @@ -37,6 +37,8 @@ #include #include +extern "C++" { + namespace std { // Types. @@ -56,4 +58,6 @@ using ::localtime; using ::strftime; } // namespace std +} // extern C++ + #endif // BIONIC_LIBSTDCPP_INCLUDE_CTIME__ diff --git a/libstdc++/include/new b/libstdc++/include/new index 19d818535..0253e8b68 100644 --- a/libstdc++/include/new +++ b/libstdc++/include/new @@ -4,6 +4,8 @@ #include +extern "C++" { + namespace std { struct nothrow_t {}; extern const nothrow_t nothrow; @@ -25,4 +27,6 @@ inline void* operator new[](std::size_t, void* p) { return p; } inline void operator delete(void*, void*) { } inline void operator delete[](void*, void*) { } +} // extern C++ + #endif // __NEW__ diff --git a/libstdc++/include/typeinfo b/libstdc++/include/typeinfo index 8a51a548c..4b48a7933 100644 --- a/libstdc++/include/typeinfo +++ b/libstdc++/include/typeinfo @@ -1,6 +1,7 @@ #ifndef _TYPEINFO_HEADER_GAURD #define _TYPEINFO_HEADER_GAURD +extern "C++" { namespace std { class type_info; @@ -25,4 +26,6 @@ private: type_info & operator=(type_info const & right); }; +} // C++ + #endif -- 2.11.0