patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Mar 28 01:05:18 2011 +0200 (2011-03-28)
changeset 2362 0888065f8c4d
parent 687 b2b6b1d46aa1
permissions -rw-r--r--
cc/gcc: cleanup the _or_later logic

So far, we've had a version always select appropriate _or_later option,
which in turn would select all previous _or_later options.

Because the dependencies on companion libs were cumulative, that was
working OK. But the upcoming 4.6 will no longer depend on libelf, so
we can't keep the cumulative scheme we've been using so far.

Have each release family select the corresponding dependencies, instead
of relying on selecting previous _or_later.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@687
     1
diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
yann@687
     2
--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
yann@687
     3
+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
yann@687
     4
@@ -401,7 +401,7 @@
yann@687
     5
 # ifdef __UCLIBC_HAS_XLOCALE__
yann@687
     6
 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@687
     7
 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@687
     8
-# else
yann@687
     9
+# elif defined __UCLIBC_HAS_LOCALE__
yann@687
    10
 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@687
    11
 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@687
    12
 # endif
yann@687
    13
@@ -556,7 +556,7 @@
yann@687
    14
 # ifdef __UCLIBC_HAS_XLOCALE__
yann@687
    15
 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@687
    16
 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@687
    17
-# else
yann@687
    18
+# elif defined __UCLIBC_HAS_LOCALE__
yann@687
    19
 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@687
    20
 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@687
    21
 # endif
yann@687
    22
diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
yann@687
    23
--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
yann@687
    24
+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
yann@687
    25
@@ -127,12 +127,25 @@
yann@687
    26
 	{
yann@687
    27
 	  // Named locale.
yann@687
    28
 	  // NB: In the GNU model wchar_t is always 32 bit wide.
yann@687
    29
+#ifdef __UCLIBC_MJN3_ONLY__
yann@687
    30
+#warning fix this... should be numeric
yann@687
    31
+#endif
yann@687
    32
+#ifdef __UCLIBC__
yann@687
    33
+# ifdef __UCLIBC_HAS_XLOCALE__
yann@687
    34
+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@687
    35
+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@687
    36
+# elif defined __UCLIBC_HAS_LOCALE__
yann@687
    37
+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@687
    38
+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@687
    39
+# endif
yann@687
    40
+#else
yann@687
    41
 	  union { char *__s; wchar_t __w; } __u;
yann@687
    42
 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
yann@687
    43
 	  _M_data->_M_decimal_point = __u.__w;
yann@687
    44
 
yann@687
    45
 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
yann@687
    46
 	  _M_data->_M_thousands_sep = __u.__w;
yann@687
    47
+#endif
yann@687
    48
 
yann@687
    49
 	  if (_M_data->_M_thousands_sep == L'\0')
yann@687
    50
 	    _M_data->_M_grouping = "";