summaryrefslogtreecommitdiffstats
path: root/include/dect/utils.h
blob: 90a9eb62755f97a6828c82a2f3ee982f4d29f8ce (plain)
1
2
3
4
5
6
7
8
9
10
#ifndef _LIBDECT_DECT_UTILS_H
#define _LIBDECT_DECT_UTILS_H

#include <stddef.h>

#define container_of(ptr, type, member) ({				\
	const typeof( ((type *)0)->member ) *__mptr = (ptr);		\
	(type *)( (char *)__mptr - offsetof(type,member) );})

#endif /* _LIBDECT_DECT_UTILS_H */