diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp | 31 | ||||
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/UString.h | 3 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp index 118751e..f64219c 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp @@ -942,6 +942,37 @@ UString UString::from(int i) return UString(p, static_cast<int>(end - p)); } +#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) +UString UString::from(int64_t i) +{ + UChar buf[1 + sizeof(i) * 3]; + UChar* end = buf + sizeof(buf) / sizeof(UChar); + UChar* p = end; + + if (i == 0) + *--p = '0'; + else if (i == LLONG_MIN) { + char minBuf[1 + sizeof(i) * 3]; + snprintf(minBuf, sizeof(minBuf) - 1, "%I64d", LLONG_MIN); + return UString(minBuf); + } else { + bool negative = false; + if (i < 0) { + negative = true; + i = -i; + } + while (i) { + *--p = static_cast<unsigned short>((i % 10) + '0'); + i /= 10; + } + if (negative) + *--p = '-'; + } + + return UString(p, static_cast<int>(end - p)); +} +#endif + UString UString::from(unsigned int u) { UChar buf[sizeof(u) * 3]; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h index d01b75d..f2572a9 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h @@ -256,6 +256,9 @@ namespace JSC { } static UString from(int); +#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) + static UString from(int64_t i); +#endif static UString from(unsigned int); static UString from(long); static UString from(double); |