[llvm-commits] [llvm-gcc-4.2] r50399 - /llvm-gcc-4.2/trunk/libstdc++-v3/include/bits/locale_facets.tcc
Anton Korobeynikov
asl at math.spbu.ru
Mon Apr 28 23:20:19 PDT 2008
Author: asl
Date: Tue Apr 29 01:20:19 2008
New Revision: 50399
URL: http://llvm.org/viewvc/llvm-project?rev=50399&view=rev
Log:
Backport from mainline (pre-GPLv3).
Fix for sizeof(const void*) > sizeof(unsigned long).
Modified:
llvm-gcc-4.2/trunk/libstdc++-v3/include/bits/locale_facets.tcc
Modified: llvm-gcc-4.2/trunk/libstdc++-v3/include/bits/locale_facets.tcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libstdc%2B%2B-v3/include/bits/locale_facets.tcc?rev=50399&r1=50398&r2=50399&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/libstdc++-v3/include/bits/locale_facets.tcc (original)
+++ llvm-gcc-4.2/trunk/libstdc++-v3/include/bits/locale_facets.tcc Tue Apr 29 01:20:19 2008
@@ -885,7 +885,13 @@
const fmtflags __fmt = __io.flags();
__io.flags(__fmt & ~ios_base::basefield | ios_base::hex);
- unsigned long __ul;
+ // LLVM LOCAL begin mainline
+ typedef __gnu_cxx::__conditional_type<(sizeof(void*)
+ <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+ _UIntPtrType __ul;
+ // LLVM LOCAL end mainline
__beg = _M_extract_int(__beg, __end, __io, __err, __ul);
// Reset from hex formatted input.
@@ -1307,8 +1313,14 @@
| ios_base::internal);
__io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase));
+ // LLVM LOCAL begin mainline
+ typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
+ <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
__s = _M_insert_int(__s, __io, __fill,
- reinterpret_cast<unsigned long>(__v));
+ reinterpret_cast<_UIntPtrType>(__v));
+ // LLVM LOCAL end mainline
__io.flags(__flags);
return __s;
}
More information about the llvm-commits
mailing list