diff --git a/src/system/kernel/util/list.cpp b/src/system/kernel/util/list.cpp index ce7cc1d853..7f7341172a 100644 --- a/src/system/kernel/util/list.cpp +++ b/src/system/kernel/util/list.cpp @@ -5,11 +5,13 @@ #include +#include -#define GET_ITEM(list, item) ((void *)((uint8 *)item - list->offset)) -#define GET_LINK(list, item) ((list_link *)((uint8 *)item + list->offset)) - +#define GET_ITEM(list, item) ({ BytePointer pointer((uint8*)item \ + - list->offset); &pointer; }) +#define GET_LINK(list, item) ({ BytePointer pointer((uint8*)item \ + + list->offset); &pointer; }) /** Initializes the list with a specified offset to the link * structure in the items that will be part of the list.