patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Oct 14 21:30:27 2008 +0000 (2008-10-14)
changeset 935 e175e3538310
parent 687 b2b6b1d46aa1
permissions -rw-r--r--
Introduce the notion of a 'sample comment'.

- presence of the sample's reported.by file is now mandatory.
- when saving a sample, reporter name & URL are queried, to avoid operator forget about creating the reported.by file.
- when saving a sample, one can store a few-liner comment.
- when recalling a sample, the reporter name, URL and comment (if present) are printed.
- update the powerpc-e500v2-linux-gnuspe sample to include Nate's comment (from his original mail).
- update all samples that were missing the reported.by file.

/trunk/scripts/saveSample.sh | 46 35 11 0 ++++++++++++++++++------
/trunk/scripts/showSamples.sh | 12 6 6 0 +++---
/trunk/samples/powerpc-e500v2-linux-gnuspe/reported.by | 15 15 0 0 ++++++++
/trunk/samples/samples.mk | 22 17 5 0 +++++++++--
4 files changed, 73 insertions(+), 22 deletions(-)
     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
     2 --- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
     3 +++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
     4 @@ -401,7 +401,7 @@
     5  # ifdef __UCLIBC_HAS_XLOCALE__
     6  	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
     7  	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
     8 -# else
     9 +# elif defined __UCLIBC_HAS_LOCALE__
    10  	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
    11  	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
    12  # endif
    13 @@ -556,7 +556,7 @@
    14  # ifdef __UCLIBC_HAS_XLOCALE__
    15  	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
    16  	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
    17 -# else
    18 +# elif defined __UCLIBC_HAS_LOCALE__
    19  	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
    20  	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
    21  # endif
    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
    23 --- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
    24 +++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
    25 @@ -127,12 +127,25 @@
    26  	{
    27  	  // Named locale.
    28  	  // NB: In the GNU model wchar_t is always 32 bit wide.
    29 +#ifdef __UCLIBC_MJN3_ONLY__
    30 +#warning fix this... should be numeric
    31 +#endif
    32 +#ifdef __UCLIBC__
    33 +# ifdef __UCLIBC_HAS_XLOCALE__
    34 +	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
    35 +	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
    36 +# elif defined __UCLIBC_HAS_LOCALE__
    37 +	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
    38 +	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
    39 +# endif
    40 +#else
    41  	  union { char *__s; wchar_t __w; } __u;
    42  	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
    43  	  _M_data->_M_decimal_point = __u.__w;
    44  
    45  	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
    46  	  _M_data->_M_thousands_sep = __u.__w;
    47 +#endif
    48  
    49  	  if (_M_data->_M_thousands_sep == L'\0')
    50  	    _M_data->_M_grouping = "";