patches/gcc/4.2.0/130-uclibc-locale-no__x.patch
changeset 747 d3e603e7c17c
parent 111 2e16b9fc302d
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/4.2.0/130-uclibc-locale-no__x.patch	Mon Jul 28 21:32:33 2008 +0000
     1.3 @@ -0,0 +1,213 @@
     1.4 +--- gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
     1.5 ++++ gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2006-03-10 15:32:37 +0100
     1.6 +@@ -60,4 +60,49 @@
     1.7 + extern "C" __typeof(wctype_l) __wctype_l;
     1.8 + #endif 
     1.9 + 
    1.10 ++# define __nl_langinfo_l nl_langinfo_l
    1.11 ++# define __strcoll_l strcoll_l
    1.12 ++# define __strftime_l strftime_l
    1.13 ++# define __strtod_l strtod_l
    1.14 ++# define __strtof_l strtof_l
    1.15 ++# define __strtold_l strtold_l
    1.16 ++# define __strxfrm_l strxfrm_l
    1.17 ++# define __newlocale newlocale
    1.18 ++# define __freelocale freelocale
    1.19 ++# define __duplocale duplocale
    1.20 ++# define __uselocale uselocale
    1.21 ++
    1.22 ++# ifdef _GLIBCXX_USE_WCHAR_T
    1.23 ++#  define __iswctype_l iswctype_l
    1.24 ++#  define __towlower_l towlower_l
    1.25 ++#  define __towupper_l towupper_l
    1.26 ++#  define __wcscoll_l wcscoll_l
    1.27 ++#  define __wcsftime_l wcsftime_l
    1.28 ++#  define __wcsxfrm_l wcsxfrm_l
    1.29 ++#  define __wctype_l wctype_l
    1.30 ++# endif
    1.31 ++
    1.32 ++#else
    1.33 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
    1.34 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
    1.35 ++# define __strtod_l(S, E, L)         strtod((S), (E))
    1.36 ++# define __strtof_l(S, E, L)         strtof((S), (E))
    1.37 ++# define __strtold_l(S, E, L)        strtold((S), (E))
    1.38 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
    1.39 ++# warning should dummy __newlocale check for C|POSIX ?
    1.40 ++# define __newlocale(a, b, c)        NULL
    1.41 ++# define __freelocale(a)             ((void)0)
    1.42 ++# define __duplocale(a)              __c_locale()
    1.43 ++//# define __uselocale ?
    1.44 ++//
    1.45 ++# ifdef _GLIBCXX_USE_WCHAR_T
    1.46 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
    1.47 ++#  define __towlower_l(C, L)          towlower((C))
    1.48 ++#  define __towupper_l(C, L)          towupper((C))
    1.49 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
    1.50 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
    1.51 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
    1.52 ++#  define __wctype_l(S, L)            wctype((S))
    1.53 ++# endif
    1.54 ++
    1.55 + #endif // GLIBC 2.3 and later
    1.56 +--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
    1.57 ++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc	2006-03-10 15:32:37 +0100
    1.58 +@@ -39,20 +39,6 @@
    1.59 + #include <langinfo.h>
    1.60 + #include <bits/c++locale_internal.h>
    1.61 + 
    1.62 +-#ifndef __UCLIBC_HAS_XLOCALE__
    1.63 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
    1.64 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
    1.65 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
    1.66 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
    1.67 +-#define __strtof_l(S, E, L)         strtof((S), (E))
    1.68 +-#define __strtod_l(S, E, L)         strtod((S), (E))
    1.69 +-#define __strtold_l(S, E, L)        strtold((S), (E))
    1.70 +-#warning should dummy __newlocale check for C|POSIX ?
    1.71 +-#define __newlocale(a, b, c)        NULL
    1.72 +-#define __freelocale(a)             ((void)0)
    1.73 +-#define __duplocale(a)              __c_locale()
    1.74 +-#endif
    1.75 +-
    1.76 + namespace std 
    1.77 + {
    1.78 +   template<>
    1.79 +--- gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
    1.80 ++++ gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc	2006-03-10 15:32:37 +0100
    1.81 +@@ -36,13 +36,6 @@
    1.82 + #include <locale>
    1.83 + #include <bits/c++locale_internal.h>
    1.84 + 
    1.85 +-#ifndef __UCLIBC_HAS_XLOCALE__
    1.86 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
    1.87 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
    1.88 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
    1.89 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
    1.90 +-#endif
    1.91 +-
    1.92 + namespace std
    1.93 + {
    1.94 +   // These are basically extensions to char_traits, and perhaps should
    1.95 +--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
    1.96 ++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2006-03-10 15:32:37 +0100
    1.97 +@@ -43,10 +43,6 @@
    1.98 + #warning tailor for stub locale support
    1.99 + #endif
   1.100 + 
   1.101 +-#ifndef __UCLIBC_HAS_XLOCALE__
   1.102 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
   1.103 +-#endif
   1.104 +-
   1.105 + namespace std
   1.106 + {
   1.107 +   // Construct and return valid pattern consisting of some combination of:
   1.108 +--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
   1.109 ++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2006-03-10 15:32:37 +0100
   1.110 +@@ -41,9 +41,6 @@
   1.111 + #ifdef __UCLIBC_MJN3_ONLY__
   1.112 + #warning tailor for stub locale support
   1.113 + #endif
   1.114 +-#ifndef __UCLIBC_HAS_XLOCALE__
   1.115 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
   1.116 +-#endif
   1.117 + 
   1.118 + namespace std
   1.119 + {
   1.120 +--- gcc/libstdc++-v3/config/locale/uclibc/time_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
   1.121 ++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.cc	2006-03-10 15:32:37 +0100
   1.122 +@@ -40,9 +40,6 @@
   1.123 + #ifdef __UCLIBC_MJN3_ONLY__
   1.124 + #warning tailor for stub locale support
   1.125 + #endif
   1.126 +-#ifndef __UCLIBC_HAS_XLOCALE__
   1.127 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
   1.128 +-#endif
   1.129 + 
   1.130 + namespace std
   1.131 + {
   1.132 +--- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
   1.133 ++++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2006-03-10 15:32:37 +0100
   1.134 +@@ -38,13 +38,6 @@
   1.135 + #undef _LIBC
   1.136 + #include <bits/c++locale_internal.h>
   1.137 + 
   1.138 +-#ifndef __UCLIBC_HAS_XLOCALE__
   1.139 +-#define __wctype_l(S, L)           wctype((S))
   1.140 +-#define __towupper_l(C, L)         towupper((C))
   1.141 +-#define __towlower_l(C, L)         towlower((C))
   1.142 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
   1.143 +-#endif
   1.144 +-
   1.145 + namespace std
   1.146 + {
   1.147 +   // NB: The other ctype<char> specializations are in src/locale.cc and
   1.148 +--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
   1.149 ++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc	2006-03-10 15:32:37 +0100
   1.150 +@@ -39,13 +39,10 @@
   1.151 + #ifdef __UCLIBC_MJN3_ONLY__
   1.152 + #warning fix gettext stuff
   1.153 + #endif
   1.154 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
   1.155 +-extern "C" char *__dcgettext(const char *domainname,
   1.156 +-			     const char *msgid, int category);
   1.157 + #undef gettext
   1.158 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
   1.159 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
   1.160 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
   1.161 + #else
   1.162 +-#undef gettext
   1.163 + #define gettext(msgid) (msgid)
   1.164 + #endif
   1.165 + 
   1.166 +--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
   1.167 ++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-03-10 15:32:37 +0100
   1.168 +@@ -36,15 +36,11 @@
   1.169 + #ifdef __UCLIBC_MJN3_ONLY__
   1.170 + #warning fix prototypes for *textdomain funcs
   1.171 + #endif
   1.172 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
   1.173 +-extern "C" char *__textdomain(const char *domainname);
   1.174 +-extern "C" char *__bindtextdomain(const char *domainname,
   1.175 +-				  const char *dirname);
   1.176 +-#else
   1.177 +-#undef __textdomain
   1.178 +-#undef __bindtextdomain
   1.179 +-#define __textdomain(D)           ((void)0)
   1.180 +-#define __bindtextdomain(D,P)     ((void)0)
   1.181 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
   1.182 ++#undef textdomain
   1.183 ++#undef bindtextdomain
   1.184 ++#define textdomain(D)           ((void)0)
   1.185 ++#define bindtextdomain(D,P)     ((void)0)
   1.186 + #endif
   1.187 + 
   1.188 +   // Non-virtual member functions.
   1.189 +@@ -70,7 +66,7 @@
   1.190 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
   1.191 + 			   const char* __dir) const
   1.192 +     { 
   1.193 +-      __bindtextdomain(__s.c_str(), __dir);
   1.194 ++      bindtextdomain(__s.c_str(), __dir);
   1.195 +       return this->do_open(__s, __loc); 
   1.196 +     }
   1.197 + 
   1.198 +@@ -90,7 +86,7 @@
   1.199 +     { 
   1.200 +       // No error checking is done, assume the catalog exists and can
   1.201 +       // be used.
   1.202 +-      __textdomain(__s.c_str());
   1.203 ++      textdomain(__s.c_str());
   1.204 +       return 0;
   1.205 +     }
   1.206 + 
   1.207 +--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
   1.208 ++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.h	2006-03-10 15:32:37 +0100
   1.209 +@@ -68,6 +68,7 @@
   1.210 + {
   1.211 +   extern "C" __typeof(uselocale) __uselocale;
   1.212 + }
   1.213 ++#define __uselocale uselocale
   1.214 + #endif
   1.215 + 
   1.216 + namespace std