This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[PATCH] Preliminary fix for codecvt_members_unicode_wchar_t
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: libstdc++ at gcc dot gnu dot org
- Cc: Ulrich dot Weigand at de dot ibm dot com, bkoz at redhat dot com
- Date: Sat, 23 Mar 2002 12:59:04 +0100
- Subject: [PATCH] Preliminary fix for codecvt_members_unicode_wchar_t
Hi again,
if and when, after due testing on s390/powerpc, the patch for the char test goes
in, the analogous fix below for the wchar_t case should probably follow (it also
protects the test with #ifdef _GLIBCPP_USE_WCHAR_T)
However, the real issue with s390/powerpc is still not solved, since is the
VERIFY( r1 == codecvt_base::ok) to fail, *before* comparing i_arr and i_lit.
Ulrich, could you possibly dig deeper the wchar_t case?
Ciao, Paolo.
/////////////////
2002-03-23 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Paolo Carlini <pcarlini@unitus.it>
* testsuite/locale/codecvt_members_unicode_wchar_t.cc
(test01): Protect the test with _GLIBCPP_USE_WCHAR_T;
fix i_lit_base array, making it independent from the
endianness of the platform.
--- codecvt_members_unicode_wchar_t.cc.~1.1.~ Tue Aug 28 08:19:35 2001
+++ codecvt_members_unicode_wchar_t.cc Sat Mar 23 12:33:25 2002
@@ -26,6 +26,7 @@
using namespace std;
#ifdef _GLIBCPP_USE___ENC_TRAITS
+#ifdef _GLIBCPP_USE_WCHAR_T
void
initialize_state(__enc_traits& state)
@@ -54,13 +55,14 @@
};
const ext_type* e_lit = e_lit_base;
- int_type i_lit_base[24] =
+ char i_lit_base[48] =
{
- 0x6200, 0x6c00, 0x6100, 0x6300, 0x6b00, 0x2000, 0x7000, 0x6500, 0x6100,
- 0x7200, 0x6c00, 0x2000, 0x6a00, 0x6100, 0x7300, 0x6d00, 0x6900, 0x6e00,
- 0x6500, 0x2000, 0x7400, 0x6500, 0x6100, 0xa000
+ 0x00, 0x62, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x63, 0x00, 0x6b, 0x00, 0x20,
+ 0x00, 0x70, 0x00, 0x65, 0x00, 0x61, 0x00, 0x72, 0x00, 0x6c, 0x00, 0x20,
+ 0x00, 0x6a, 0x00, 0x61, 0x00, 0x73, 0x00, 0x6d, 0x00, 0x69, 0x00, 0x6e,
+ 0x00, 0x65, 0x00, 0x20, 0x00, 0x74, 0x00, 0x65, 0x00, 0x61, 0x00, 0xa0
};
- const int_type* i_lit = i_lit_base;
+ const int_type* i_lit = reinterpret_cast<int_type*>(i_lit_base);
const ext_type* efrom_next;
const int_type* ifrom_next;
@@ -120,14 +122,16 @@
delete [] e_arr;
delete [] i_arr;
}
+#endif // _GLIBCPP_USE_WCHAR_T
#endif // _GLIBCPP_USE___ENC_TRAITS
int main ()
{
-#if _GLIBCPP_USE___ENC_TRAITS
+#ifdef _GLIBCPP_USE___ENC_TRAITS
+#ifdef _GLIBCPP_USE_WCHAR_T
test01();
+#endif
#endif
-
return 0;
}