summaryrefslogtreecommitdiff
path: root/include/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/util.h')
-rw-r--r--include/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h
index 2cd15efa65..eca264a3f7 100644
--- a/include/util.h
+++ b/include/util.h
@@ -44,6 +44,9 @@
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
+#ifndef OFFSET_OF
+#define OFFSET_OF(struc, field) ((uint32_t)&(((const struc * const)0)->field))
+#endif
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif