This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[PATCH, libstdc++-v3] Fix import of wide character related symbols in stdlib.h wraper
- From: Andris Pavenis <andris dot pavenis at iki dot fi>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org
- Date: Tue, 26 Jan 2016 06:40:00 +0200
- Subject: [PATCH, libstdc++-v3] Fix import of wide character related symbols in stdlib.h wraper
- Authentication-results: sourceware.org; auth=none
- Razorgate-kas: Status: not_detected
- Razorgate-kas: Rate: 0
- Razorgate-kas: Envelope from:
- Razorgate-kas: Version: 5.5.3
- Razorgate-kas: LuaCore: 80 2014-11-10_18-01-23 260f8afb9361da3c7edfd3a8e3a4ca908191ad29
- Razorgate-kas: Lua profiles 69136 [Nov 12 2014]
- Razorgate-kas: Method: none
include/c_compatibility/stdlib.h imports wide character related symbols
into global namespace unconditionaly which causes libstdc++-v3 build
to fail when one or both of _GLIBCXX_USE_WCHAR_T and _GLIBCXX_HAVE_MBSTATE_T
are not defined.
Included patch changes it to import them into global namespace only
when they are defined in cstdlib
Andris
2016-01-26 Andris Pavenis <andris.pavenis@iki.fi>
* include/c_compatibility/stdlib.h: Include wide character related
definitions only when they are available in cstdlib.
>From 17778d89abe4f51f929806e67d2e2352b6b4376e Mon Sep 17 00:00:00 2001
From: Andris Pavenis <andris.pavenis@iki.fi>
Date: Tue, 26 Jan 2016 06:24:48 +0200
Subject: [PATCH] [PATCH,libstdc++-v3] Fix use use wide character related
symbols in stdlib.h wrapper
* include/c_compatibility/stdlib.h: include wide character related
definitions only when they are available in cstdlib
---
libstdc++-v3/include/c_compatibility/stdlib.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libstdc++-v3/include/c_compatibility/stdlib.h b/libstdc++-v3/include/c_compatibility/stdlib.h
index bd72580..31e7e5f 100644
--- a/libstdc++-v3/include/c_compatibility/stdlib.h
+++ b/libstdc++-v3/include/c_compatibility/stdlib.h
@@ -62,9 +62,11 @@ using std::getenv;
using std::labs;
using std::ldiv;
using std::malloc;
+#ifdef _GLIBCXX_HAVE_MBSTATE_T
using std::mblen;
using std::mbstowcs;
using std::mbtowc;
+#endif // _GLIBCXX_HAVE_MBSTATE_T
using std::qsort;
using std::rand;
using std::realloc;
@@ -73,8 +75,10 @@ using std::strtod;
using std::strtol;
using std::strtoul;
using std::system;
+#ifdef _GLIBCXX_USE_WCHAR_T
using std::wcstombs;
using std::wctomb;
+#endif // _GLIBCXX_USE_WCHAR_T
#endif
#endif
--
2.5.0