This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH to libstdc++: Don't be sloppy about names used in templates
- From: gcc at integrable-solutions dot net
- To: gcc-patches at gcc dot gnu dot org
- Cc: libstdc++ at gcc dot gnu dot org
- Date: 14 Jul 2003 15:36:19 +0200
- Subject: PATCH to libstdc++: Don't be sloppy about names used in templates
- Organization: Integrable Solutions
Mark's recent patch to make the compiler more conforming has the
collateral damage of sending libstdc++-3 to non-bootstrapville on an
i686-pc-linux-gnu. Fixed with this.
-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/ChangeLog,v
retrieving revision 1.1872
diff -p -r1.1872 ChangeLog
*** ChangeLog 14 Jul 2003 02:52:04 -0000 1.1872
--- ChangeLog 14 Jul 2003 13:25:58 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2003-07-14 Gabriel Dos Reis <gcc@integrable-solutions.net>
+
+ * config/locale/gnu/c_locale.h (__convert_from_v): Include
+ <cstring> and <cstdlib>. Qualify names.
+
2003-07-13 Mark Mitchell <mark@codesourcery.com>
* config/locale/generic/c_locale.h: Include <cstdlib> and
Index: config/locale/gnu/c_locale.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/locale/gnu/c_locale.h,v
retrieving revision 1.7
diff -p -r1.7 c_locale.h
*** config/locale/gnu/c_locale.h 5 Jul 2003 04:05:30 -0000 1.7
--- config/locale/gnu/c_locale.h 14 Jul 2003 13:25:58 -0000
***************
*** 38,43 ****
--- 38,45 ----
#pragma GCC system_header
+ #include <cstring> // get std::strlen
+ #include <cstdlib> // get std::malloc
#include <clocale>
#include <langinfo.h> // For codecvt
#include <iconv.h> // For codecvt using iconv, iconv_t
*************** namespace std
*** 73,82 ****
_Tv __v, const __c_locale&, int __prec = -1)
{
char* __old = setlocale(LC_ALL, NULL);
! char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
if (__sav)
! strcpy(__sav, __old);
! setlocale(LC_ALL, "C");
#endif
int __ret;
--- 75,84 ----
_Tv __v, const __c_locale&, int __prec = -1)
{
char* __old = setlocale(LC_ALL, NULL);
! char* __sav = static_cast<char*>(std::malloc(std::strlen(__old) + 1));
if (__sav)
! std::strcpy(__sav, __old);
! std::setlocale(LC_ALL, "C");
#endif
int __ret;
*************** namespace std
*** 87,102 ****
__ret = snprintf(__out, __size, __fmt, __v);
#else
if (__prec >= 0)
! __ret = sprintf(__out, __fmt, __prec, __v);
else
! __ret = sprintf(__out, __fmt, __v);
#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__gnu_cxx::__uselocale(__old);
#else
! setlocale(LC_ALL, __sav);
! free(__sav);
#endif
return __ret;
}
--- 89,104 ----
__ret = snprintf(__out, __size, __fmt, __v);
#else
if (__prec >= 0)
! __ret = std::sprintf(__out, __fmt, __prec, __v);
else
! __ret = std::sprintf(__out, __fmt, __v);
#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__gnu_cxx::__uselocale(__old);
#else
! std::setlocale(LC_ALL, __sav);
! std::free(__sav);
#endif
return __ret;
}