diff options
Diffstat (limited to 'modules/sparkler/container.h')
-rw-r--r-- | modules/sparkler/container.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/sparkler/container.h b/modules/sparkler/container.h new file mode 100644 index 0000000..a3779e8 --- /dev/null +++ b/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 |