mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add OFFSET_OF macro that works on class member fields
This commit is contained in:
parent
24d5070520
commit
af5fd99ff4
Notes:
sideshowbarker
2024-07-16 23:05:02 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/af5fd99ff4 Pull-request: https://github.com/SerenityOS/serenity/pull/21822 Reviewed-by: https://github.com/DanShaders Reviewed-by: https://github.com/Hendiadyoin1
1 changed files with 2 additions and 0 deletions
|
@ -16,6 +16,8 @@
|
|||
|
||||
#include <AK/Assertions.h>
|
||||
|
||||
#define OFFSET_OF(class, member) (reinterpret_cast<ptrdiff_t>(&reinterpret_cast<class*>(0x1000)->member) - 0x1000)
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename T, typename U>
|
||||
|
|
Loading…
Reference in a new issue