diff options
| author | ppluzhnikov <ppluzhnikov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-23 16:36:11 +0000 |
|---|---|---|
| committer | ppluzhnikov <ppluzhnikov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-23 16:36:11 +0000 |
| commit | ac8d08a3c98897e7a17f42910956c07fd14ea06e (patch) | |
| tree | 4f6ac1b7bd6bae24e2e6b5b988bdddbc29fc992e /libstdc++-v3/src | |
| parent | 42eed6839d18a608c6250d03f21da4006f209f8e (diff) | |
| download | ppe42-gcc-ac8d08a3c98897e7a17f42910956c07fd14ea06e.tar.gz ppe42-gcc-ac8d08a3c98897e7a17f42910956c07fd14ea06e.zip | |
2013-09-23 Paul Pluzhnikov <ppluzhnikov@google.com>
* src/c++11/snprintf_lite.cc (__concat_size_t): Use
unsigned long long conditionally.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202836 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
| -rw-r--r-- | libstdc++-v3/src/c++11/snprintf_lite.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libstdc++-v3/src/c++11/snprintf_lite.cc b/libstdc++-v3/src/c++11/snprintf_lite.cc index 02a818744cb..1e0ccec813a 100644 --- a/libstdc++-v3/src/c++11/snprintf_lite.cc +++ b/libstdc++-v3/src/c++11/snprintf_lite.cc @@ -69,11 +69,17 @@ namespace __gnu_cxx { // Returns number of characters appended, or -1 if BUFSIZE is too small. int __concat_size_t(char *__buf, size_t __bufsize, size_t __val) { + // __int_to_char is explicitly instantiated and available only for + // some, but not all, types. See locale-inst.cc. +#ifdef _GLIBCXX_USE_LONG_LONG + unsigned long long __val2 = __val; +#else + unsigned long __val2 = __val; +#endif // Long enough for decimal representation. - unsigned long long __val_ull = __val; - int __ilen = 3 * sizeof(__val_ull); + int __ilen = 3 * sizeof(__val2); char *__cs = static_cast<char*>(__builtin_alloca(__ilen)); - size_t __len = std::__int_to_char(__cs + __ilen, __val_ull, + size_t __len = std::__int_to_char(__cs + __ilen, __val2, std::__num_base::_S_atoms_out, std::ios_base::dec, true); if (__bufsize < __len) |

