diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 523192fd79..bc877d8125 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -869,7 +869,7 @@ typedef UINTN *BASE_LIST; @return A pointer to the structure from one of it's elements. **/ -#define BASE_CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field))) +#define BASE_CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field))) /** Rounds a value up to the next boundary using a specified alignment.