[libstdc++] Avoid referencing wchar/mbchar functions when not provided by C library.

Bernardo Innocenti bernie@develer.com
Fri Sep 5 23:43:00 GMT 2003


Avoid referencing wchar and mbchar related functions when _GLIBCXX_USE_WCHAR_T
and _GLIBCXX_HAVE_MBSTATE_T arn't defined. This patch is required to link with
uClibc (a C library targeted at embedded systems).

uClibc is not a currently supported target for libstdc++, but during the next
days I'm going to submit more patches. The final goal is merging in everything
required to fully support uClibc and uClinux.


2003-08-09  Bernardo Innocenti  <bernie@develer.com>

	* include/c_std/std_cstdlib.h: Avoid using missing C library symbols.


--- libstdc++-v3/include/c_std/std_cstdlib.h	2003-04-18 12:08:05.000000000 +0200
+++ libstdc++-v3/include/c_std/std_cstdlib.h	2003-07-26 00:50:26.000000000 +0200
@@ -99,23 +99,27 @@ namespace std 
   using ::free;
   using ::getenv;
   using ::labs;
   using ::ldiv;
   using ::malloc;
+#ifdef _GLIBCXX_HAVE_MBSTATE_T
   using ::mblen;
   using ::mbstowcs;
   using ::mbtowc;
+#endif // _GLIBCXX_HAVE_MBSTATE_T
   using ::qsort;
   using ::rand;
   using ::realloc;
   using ::srand;
   using ::strtod;
   using ::strtol;
   using ::strtoul;
   using ::system;
+#ifdef _GLIBCXX_USE_WCHAR_T
   using ::wcstombs;
   using ::wctomb;
+#endif // _GLIBCXX_USE_WCHAR_T 
 
   inline long 
   abs(long __i) { return labs(__i); }
 
   inline ldiv_t


-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/

Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html





More information about the Libstdc++ mailing list