From af5fd99ff434529f5c8cc085bbd42483a3884781 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 6 Nov 2023 15:18:15 +0100 Subject: [PATCH] AK: Add OFFSET_OF macro that works on class member fields --- AK/StdLibExtras.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index 57c986c67c..6d6dba878c 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -16,6 +16,8 @@ #include +#define OFFSET_OF(class, member) (reinterpret_cast(&reinterpret_cast(0x1000)->member) - 0x1000) + namespace AK { template