This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3 PATCH]: Fix bootstrap failure on powerpc-apple-darwin7.9.0
- From: Roger Sayle <roger at eyesopen dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 29 Jul 2006 21:33:27 -0600 (MDT)
- Subject: [v3 PATCH]: Fix bootstrap failure on powerpc-apple-darwin7.9.0
The following simple patch fixes the current bootstrap failure on
powerpc-apple-darwin7.9.0. This issue is that the darwin system
headers define the macro "_T", so this identifier can't be used.
The workaround is to simply rename the problematic use of "_T" in
include/ext/codevt_specializations.h's __iconv_adaptor.
Tested on powerpc-apple-darwin7.9.0 where a bootstrap now progresses
past the current failure. Ok for mainline?
2006-07-29 Roger Sayle <roger@eyesopen.com>
* include/ext/codevt_specializations.h (__iconv_adaptor): Use
identifier _Type instead of _T in template argument.
Index: include/ext/codecvt_specializations.h
===================================================================
*** include/ext/codecvt_specializations.h (revision 115817)
--- include/ext/codecvt_specializations.h (working copy)
*************** _GLIBCXX_BEGIN_NAMESPACE(std)
*** 301,312 ****
// argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
// uses 'char**', which matches the POSIX 1003.1-2001 standard.
// Using this adaptor, g++ will do the work for us.
! template<typename _T>
inline size_t
! __iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
iconv_t __cd, char** __inbuf, size_t* __inbytes,
char** __outbuf, size_t* __outbytes)
! { return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }
template<typename _InternT, typename _ExternT>
codecvt_base::result
--- 301,312 ----
// argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
// uses 'char**', which matches the POSIX 1003.1-2001 standard.
// Using this adaptor, g++ will do the work for us.
! template<typename _Type>
inline size_t
! __iconv_adaptor(size_t(*__func)(iconv_t, _Type, size_t*, char**, size_t*),
iconv_t __cd, char** __inbuf, size_t* __inbytes,
char** __outbuf, size_t* __outbytes)
! { return __func(__cd, (_Type)__inbuf, __inbytes, __outbuf, __outbytes); }
template<typename _InternT, typename _ExternT>
codecvt_base::result
Roger
--