Commit b7933615 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Add container_of() convenience wrapper for offsetof()

(Name comes Linux kernel. Implementation is from scratch.)
parent 5d992293
......@@ -842,6 +842,9 @@ typedef struct {
VLC_API bool vlc_ureduce( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t );
#define container_of(ptr, type, member) \
((type *)(((char *)(ptr)) - offsetof(type, member)))
/* Aligned memory allocator */
#ifdef __MINGW32__
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment