#define OFFSET_OF_FIELD ( type,
field   )     ((UINT32)&(((type *)0)->field))

Obtain the offset of a field to a structure address.

Description:
This API is used to obtain the offset of a field to a structure address.
注意:
  • None.
参数:
参数名称 描述
type  [IN] Structure name.
field  [IN] Name of the field of which the offset is to be measured.
返回值:
返回值 描述
Offset  of the field to the structure address.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见:
自从:
Huawei LiteOS V100R001C00

在文件los_list.h238行定义。