aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--liberty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/liberty.c b/liberty.c
index 977a2e9..e21b699 100644
--- a/liberty.c
+++ b/liberty.c
@@ -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