summaryrefslogtreecommitdiff
path: root/libavutil/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r--libavutil/internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h
index ecd535b808..210c52437e 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -84,6 +84,13 @@
// to be forced to tokenize __VA_ARGS__
#define E1(x) x
+/* Check if the hard coded offset of a struct member still matches reality.
+ * Induce a compilation failure if not.
+ */
+#define AV_CHECK_OFFSET(s, m, o) struct check_##o { \
+ int x_##o[offsetof(s, m) == o? 1: -1]; \
+ }
+
#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
uint8_t la_##v[sizeof(t s o) + (a)]; \
t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)