Add a CONTAINER_OF macro
This commit is contained in:
parent
b5724a654a
commit
4dfd88c2c8
|
@ -112,6 +112,9 @@ extern char **environ;
|
|||
#define STRINGIFY(x) #x
|
||||
#define XSTRINGIFY(x) STRINGIFY (x)
|
||||
|
||||
#define CONTAINER_OF(pointer, type, member) \
|
||||
((type *) ((char *) pointer - offsetof (type, member)))
|
||||
|
||||
// --- Logging -----------------------------------------------------------------
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue