From 1d8e1afc009f2a916f672fc57f4971504bb13fb3 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Sat, 24 Jul 2021 17:06:31 +0200 Subject: [PATCH] lavu/internal: add FF_FIELD_AT(). --- libavutil/internal.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavutil/internal.h b/libavutil/internal.h index 73498dc70d..b032e7540a 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -99,6 +99,11 @@ #define FF_PTR_ADD(ptr, off) ((off) ? (ptr) + (off) : (ptr)) +/** + * Access a field in a structure by its offset. + */ +#define FF_FIELD_AT(type, off, obj) (*(type *)((char *)&(obj) + (off))) + #include "libm.h" /**