]> git.pld-linux.org Git - packages/gcc.git/blob - gcc32-locale_in_ctype_members.patch
- more specific impls for sparc and ppc (but system.adss are missing)
[packages/gcc.git] / gcc32-locale_in_ctype_members.patch
1 --- libstdc++-v3/config/locale/gnu/ctype_members.cc.jj  2002-08-30 12:09:12.000000000 +0200
2 +++ libstdc++-v3/config/locale/gnu/ctype_members.cc     2002-09-02 15:25:15.000000000 +0200
3 @@ -166,15 +166,30 @@ namespace std
4    wchar_t
5    ctype<wchar_t>::
6    do_widen(char __c) const
7 -  { return btowc(__c); }
8 -  
9 +  {
10 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
11 +    __c_locale __old = __uselocale(_M_c_locale_ctype);
12 +#endif
13 +    wchar_t __ret = btowc(__c);
14 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
15 +    __uselocale(__old);
16 +#endif
17 +    return __ret;
18 +  }
19 +
20    const char* 
21    ctype<wchar_t>::
22    do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
23    {
24 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
25 +    __c_locale __old = __uselocale(_M_c_locale_ctype);
26 +#endif
27      mbstate_t __state;
28      memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
29      mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
30 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
31 +    __uselocale(__old);
32 +#endif
33      return __hi;
34    }
35  
36 @@ -182,7 +197,13 @@ namespace std
37    ctype<wchar_t>::
38    do_narrow(wchar_t __wc, char __dfault) const
39    { 
40 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
41 +    __c_locale __old = __uselocale(_M_c_locale_ctype);
42 +#endif
43      int __c = wctob(__wc);
44 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
45 +    __uselocale(__old);
46 +#endif
47      return (__c == EOF ? __dfault : static_cast<char>(__c)); 
48    }
49  
50 @@ -191,6 +212,9 @@ namespace std
51    do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
52             char* __dest) const
53    {
54 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
55 +    __c_locale __old = __uselocale(_M_c_locale_ctype);
56 +#endif
57      size_t __offset = 0;
58      while (true)
59        {
60 @@ -208,6 +232,9 @@ namespace std
61         else
62           break;
63        }
64 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
65 +    __uselocale(__old);
66 +#endif
67      return __hi;
68    }
69  #endif //  _GLIBCPP_USE_WCHAR_T
This page took 0.197063 seconds and 3 git commands to generate.