about summary refs log tree commit diff stats
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
new file mode 100644
index 0000000..8c5725d
--- /dev/null
+++ b/src/common.h
@@ -0,0 +1,7 @@
+#ifndef SRC_COMMON_H_
+#define SRC_COMMON_H_
+
+#define container_of(ptr, type, member) \
+  ((type *) ((char *) (ptr) - offsetof(type, member)))
+
+#endif  /* SRC_COMMON_H_ */