patches/gcc/4.3.1/550-uclibc-locale-no__x.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 28 21:08:01 2008 +0000 (2008-07-28)
changeset 746 b150d6f590fc
parent 552 patches/gcc/4.3.1/550-203-uclibc-locale-no__x.patch@4edbcdb17e3d
permissions -rw-r--r--
Third go at renaming patches to contain neither the package name nor the package version.
     1 Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch
     2 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
     3 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
     4 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
     5 @@ -60,4 +60,49 @@
     6  extern "C" __typeof(wctype_l) __wctype_l;
     7  #endif 
     8  
     9 +# define __nl_langinfo_l nl_langinfo_l
    10 +# define __strcoll_l strcoll_l
    11 +# define __strftime_l strftime_l
    12 +# define __strtod_l strtod_l
    13 +# define __strtof_l strtof_l
    14 +# define __strtold_l strtold_l
    15 +# define __strxfrm_l strxfrm_l
    16 +# define __newlocale newlocale
    17 +# define __freelocale freelocale
    18 +# define __duplocale duplocale
    19 +# define __uselocale uselocale
    20 +
    21 +# ifdef _GLIBCXX_USE_WCHAR_T
    22 +#  define __iswctype_l iswctype_l
    23 +#  define __towlower_l towlower_l
    24 +#  define __towupper_l towupper_l
    25 +#  define __wcscoll_l wcscoll_l
    26 +#  define __wcsftime_l wcsftime_l
    27 +#  define __wcsxfrm_l wcsxfrm_l
    28 +#  define __wctype_l wctype_l
    29 +# endif
    30 +
    31 +#else
    32 +# define __nl_langinfo_l(N, L)       nl_langinfo((N))
    33 +# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
    34 +# define __strtod_l(S, E, L)         strtod((S), (E))
    35 +# define __strtof_l(S, E, L)         strtof((S), (E))
    36 +# define __strtold_l(S, E, L)        strtold((S), (E))
    37 +# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
    38 +# warning should dummy __newlocale check for C|POSIX ?
    39 +# define __newlocale(a, b, c)        NULL
    40 +# define __freelocale(a)             ((void)0)
    41 +# define __duplocale(a)              __c_locale()
    42 +//# define __uselocale ?
    43 +//
    44 +# ifdef _GLIBCXX_USE_WCHAR_T
    45 +#  define __iswctype_l(C, M, L)       iswctype((C), (M))
    46 +#  define __towlower_l(C, L)          towlower((C))
    47 +#  define __towupper_l(C, L)          towupper((C))
    48 +#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
    49 +//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
    50 +#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
    51 +#  define __wctype_l(S, L)            wctype((S))
    52 +# endif
    53 +
    54  #endif // GLIBC 2.3 and later
    55 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
    56 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
    57 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
    58 @@ -39,20 +39,6 @@
    59  #include <langinfo.h>
    60  #include <bits/c++locale_internal.h>
    61  
    62 -#ifndef __UCLIBC_HAS_XLOCALE__
    63 -#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
    64 -#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
    65 -#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
    66 -#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
    67 -#define __strtof_l(S, E, L)         strtof((S), (E))
    68 -#define __strtod_l(S, E, L)         strtod((S), (E))
    69 -#define __strtold_l(S, E, L)        strtold((S), (E))
    70 -#warning should dummy __newlocale check for C|POSIX ?
    71 -#define __newlocale(a, b, c)        NULL
    72 -#define __freelocale(a)             ((void)0)
    73 -#define __duplocale(a)              __c_locale()
    74 -#endif
    75 -
    76  namespace std 
    77  {
    78    template<>
    79 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
    80 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
    81 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
    82 @@ -68,6 +68,7 @@
    83  {
    84    extern "C" __typeof(uselocale) __uselocale;
    85  }
    86 +#define __uselocale uselocale
    87  #endif
    88  
    89  namespace std
    90 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
    91 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
    92 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
    93 @@ -36,13 +36,6 @@
    94  #include <locale>
    95  #include <bits/c++locale_internal.h>
    96  
    97 -#ifndef __UCLIBC_HAS_XLOCALE__
    98 -#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
    99 -#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
   100 -#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
   101 -#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
   102 -#endif
   103 -
   104  namespace std
   105  {
   106    // These are basically extensions to char_traits, and perhaps should
   107 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
   108 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
   109 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
   110 @@ -38,13 +38,6 @@
   111  #undef _LIBC
   112  #include <bits/c++locale_internal.h>
   113  
   114 -#ifndef __UCLIBC_HAS_XLOCALE__
   115 -#define __wctype_l(S, L)           wctype((S))
   116 -#define __towupper_l(C, L)         towupper((C))
   117 -#define __towlower_l(C, L)         towlower((C))
   118 -#define __iswctype_l(C, M, L)      iswctype((C), (M))
   119 -#endif
   120 -
   121  namespace std
   122  {
   123    // NB: The other ctype<char> specializations are in src/locale.cc and
   124 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
   125 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
   126 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
   127 @@ -39,13 +39,10 @@
   128  #ifdef __UCLIBC_MJN3_ONLY__
   129  #warning fix gettext stuff
   130  #endif
   131 -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
   132 -extern "C" char *__dcgettext(const char *domainname,
   133 -			     const char *msgid, int category);
   134  #undef gettext
   135 -#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
   136 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
   137 +#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
   138  #else
   139 -#undef gettext
   140  #define gettext(msgid) (msgid)
   141  #endif
   142  
   143 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   144 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
   145 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
   146 @@ -36,15 +36,11 @@
   147  #ifdef __UCLIBC_MJN3_ONLY__
   148  #warning fix prototypes for *textdomain funcs
   149  #endif
   150 -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
   151 -extern "C" char *__textdomain(const char *domainname);
   152 -extern "C" char *__bindtextdomain(const char *domainname,
   153 -				  const char *dirname);
   154 -#else
   155 -#undef __textdomain
   156 -#undef __bindtextdomain
   157 -#define __textdomain(D)           ((void)0)
   158 -#define __bindtextdomain(D,P)     ((void)0)
   159 +#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
   160 +#undef textdomain
   161 +#undef bindtextdomain
   162 +#define textdomain(D)           ((void)0)
   163 +#define bindtextdomain(D,P)     ((void)0)
   164  #endif
   165  
   166    // Non-virtual member functions.
   167 @@ -70,7 +66,7 @@
   168      messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
   169  			   const char* __dir) const
   170      { 
   171 -      __bindtextdomain(__s.c_str(), __dir);
   172 +      bindtextdomain(__s.c_str(), __dir);
   173        return this->do_open(__s, __loc); 
   174      }
   175  
   176 @@ -90,7 +86,7 @@
   177      { 
   178        // No error checking is done, assume the catalog exists and can
   179        // be used.
   180 -      __textdomain(__s.c_str());
   181 +      textdomain(__s.c_str());
   182        return 0;
   183      }
   184  
   185 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   186 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
   187 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
   188 @@ -43,10 +43,6 @@
   189  #warning tailor for stub locale support
   190  #endif
   191  
   192 -#ifndef __UCLIBC_HAS_XLOCALE__
   193 -#define __nl_langinfo_l(N, L)         nl_langinfo((N))
   194 -#endif
   195 -
   196  namespace std
   197  {
   198    // Construct and return valid pattern consisting of some combination of:
   199 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
   200 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
   201 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
   202 @@ -41,9 +41,6 @@
   203  #ifdef __UCLIBC_MJN3_ONLY__
   204  #warning tailor for stub locale support
   205  #endif
   206 -#ifndef __UCLIBC_HAS_XLOCALE__
   207 -#define __nl_langinfo_l(N, L)         nl_langinfo((N))
   208 -#endif
   209  
   210  namespace std
   211  {
   212 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
   213 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
   214 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
   215 @@ -40,9 +40,6 @@
   216  #ifdef __UCLIBC_MJN3_ONLY__
   217  #warning tailor for stub locale support
   218  #endif
   219 -#ifndef __UCLIBC_HAS_XLOCALE__
   220 -#define __nl_langinfo_l(N, L)         nl_langinfo((N))
   221 -#endif
   222  
   223  namespace std
   224  {