Add lock-free RCU queue and stack
[urcu.git] / urcu / compiler.h
index fcab5ea591e83e21efa471df038b2500efde3ad8..fb8b8293ca132f683f9639c3a2502e934d17c326 100644 (file)
 #define BITS_PER_LONG  32
 #endif
 
+#define container_of(ptr, type, member)                                        \
+       ({                                                              \
+               const typeof(((type *)NULL)->member) * __ptr = (ptr);   \
+               (type *)((char *)__ptr - offsetof(type, member));       \
+       })
+
 #endif /* _URCU_COMPILER_H */
This page took 0.023152 seconds and 4 git commands to generate.