mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
Add itostr(long) for our furry 64-bit friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15885 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
274ba03f49
commit
b5e1decefb
@ -84,6 +84,13 @@ static inline std::string utostr(unsigned X, bool isNeg = false) {
|
|||||||
return std::string(BufPtr);
|
return std::string(BufPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline std::string itostr(long X) {
|
||||||
|
if (X < 0)
|
||||||
|
return utostr(static_cast<uint64_t>(-X), true);
|
||||||
|
else
|
||||||
|
return utostr(static_cast<uint64_t>(X));
|
||||||
|
}
|
||||||
|
|
||||||
static inline std::string itostr(int X) {
|
static inline std::string itostr(int X) {
|
||||||
if (X < 0)
|
if (X < 0)
|
||||||
return utostr(static_cast<unsigned>(-X), true);
|
return utostr(static_cast<unsigned>(-X), true);
|
||||||
|
@ -84,6 +84,13 @@ static inline std::string utostr(unsigned X, bool isNeg = false) {
|
|||||||
return std::string(BufPtr);
|
return std::string(BufPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline std::string itostr(long X) {
|
||||||
|
if (X < 0)
|
||||||
|
return utostr(static_cast<uint64_t>(-X), true);
|
||||||
|
else
|
||||||
|
return utostr(static_cast<uint64_t>(X));
|
||||||
|
}
|
||||||
|
|
||||||
static inline std::string itostr(int X) {
|
static inline std::string itostr(int X) {
|
||||||
if (X < 0)
|
if (X < 0)
|
||||||
return utostr(static_cast<unsigned>(-X), true);
|
return utostr(static_cast<unsigned>(-X), true);
|
||||||
|
Loading…
Reference in New Issue
Block a user