1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

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.
This commit is contained in:
Andreas Kling 2019-10-07 10:46:58 +02:00
parent 749e3f0f30
commit a7f538fb63
2 changed files with 18 additions and 7 deletions

View file

@ -194,9 +194,16 @@ public:
}
static String format(const char*, ...);
static String number(size_t);
static String number(unsigned);
static String number(int);
static String number(u64);
static String number(u32);
static String number(i32);
#ifdef __serenity__
static String number(size_t n)
{
return number((u32)n);
}
#endif
StringView view() const { return { characters(), length() }; }