diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-07 10:46:58 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-07 10:56:44 +0200 |
commit | a7f538fb637e2938f8388fd10e640679a0b00b6f (patch) | |
tree | a1b8c1b5d8378e2bdbd695b51b432b30e1b24b33 /AK/String.cpp | |
parent | 749e3f0f30ac441284ccf467d592d5e76c8a2268 (diff) | |
download | serenity-a7f538fb637e2938f8388fd10e640679a0b00b6f.zip |
AK: Make String compile on platforms where size_t==u32
This kind of thing is a bit annoying. On Serenity, size_t is the same
size as u32, but not the same type. Because of "long" or whatever.
This patch makes String not complain about duplicate overloads.
Diffstat (limited to 'AK/String.cpp')
-rw-r--r-- | AK/String.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/AK/String.cpp b/AK/String.cpp index 076271f3ac..665936af54 100644 --- a/AK/String.cpp +++ b/AK/String.cpp @@ -184,17 +184,21 @@ unsigned String::to_uint(bool& ok) const return value; } -String String::number(size_t value) +String String::number(u64 value) { - return String::format("%zu", value); +#ifdef __serenity__ + return String::format("%Q", value); +#else + return String::format("%llu", value); +#endif } -String String::number(unsigned value) +String String::number(u32 value) { return String::format("%u", value); } -String String::number(int value) +String String::number(i32 value) { return String::format("%d", value); } |