This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Fix libstdc++/40511


Hi,

sanity checked x86_64-linux, committed to mainline.

Paolo.

////////////////
2009-06-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/40511
	* config/locale/gnu/c_locale.cc: Don't use LC_CTYPE_MASK together
	with glibc2.2.x.
Index: config/locale/gnu/c_locale.cc
===================================================================
--- config/locale/gnu/c_locale.cc	(revision 149088)
+++ config/locale/gnu/c_locale.cc	(working copy)
@@ -155,7 +155,11 @@
     if (__dup == __c_locale(0))
       __throw_runtime_error(__N("locale::facet::_S_lc_ctype_c_locale "
 				"duplocale error"));
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
     __c_locale __changed = __newlocale(LC_CTYPE_MASK, __s, __dup);
+#else
+    __c_locale __changed = __newlocale(1 << LC_CTYPE, __s, __dup);
+#endif
     if (__changed == __c_locale(0))
       {
 	__freelocale(__dup);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]