summaryrefslogtreecommitdiff
path: root/src/modules/sparkler/container.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/sparkler/container.h')
-rw-r--r--src/modules/sparkler/container.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/sparkler/container.h b/src/modules/sparkler/container.h
new file mode 100644
index 0000000..a3779e8
--- /dev/null
+++ b/src/modules/sparkler/container.h
@@ -0,0 +1,11 @@
+#ifndef _CONTAINER_H
+#define _CONTAINER_H
+
+#include <stddef.h>
+
+#ifndef container_of
+#define container_of(_ptr, _type, _member) \
+ (_type *)((void *)(_ptr) - offsetof(_type, _member))
+#endif
+
+#endif
© All Rights Reserved