mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)
Use this instead of uintptr_t throughout the codebase. This makes it possible to pass a FlatPtr to something that has u32 and u64 overloads.
This commit is contained in:
parent
b98d8ad5b0
commit
b1058b33fb
36 changed files with 164 additions and 161 deletions
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <AK/IterationDecision.h>
|
||||
#include <AK/Platform.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
|
||||
#ifdef __serenity__
|
||||
typedef unsigned char u8;
|
||||
|
@ -89,6 +90,8 @@ typedef __PTRDIFF_TYPE__ __ptrdiff_t;
|
|||
|
||||
#endif
|
||||
|
||||
typedef Conditional<sizeof(void*) == 8, u64, u32>::Type FlatPtr;
|
||||
|
||||
constexpr unsigned KB = 1024;
|
||||
constexpr unsigned MB = KB * KB;
|
||||
constexpr unsigned GB = KB * KB * KB;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue