defines: add typeof() as it's gcc built-in

Related to MR !15
cute-signatures
Timo Teräs 2020-02-04 10:33:56 +02:00
parent 45d313c51c
commit d60477751f
1 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,10 @@ static inline int IS_ERR_OR_NULL(const void *ptr) { return IS_ERR(ptr) || !ptr;
#define unlikely(x) __builtin_expect((!!(x)),0)
#endif
#ifndef typeof
#define typeof(x) __typeof__(x)
#endif
#ifndef container_of
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \