diff options
author | Nicolas George <george@nsup.org> | 2021-07-24 17:06:31 +0200 |
---|---|---|
committer | Nicolas George <george@nsup.org> | 2021-08-14 09:17:45 +0200 |
commit | 1d8e1afc009f2a916f672fc57f4971504bb13fb3 (patch) | |
tree | 326eb8c22efdaea805593b131822bdfbaa09a7a6 /libavutil/internal.h | |
parent | 1c5610824a035604b32cb90d371f29e9d7e23607 (diff) | |
download | ffmpeg-1d8e1afc009f2a916f672fc57f4971504bb13fb3.tar.gz |
lavu/internal: add FF_FIELD_AT().
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r-- | libavutil/internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
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" /** |