1 #ifndef _EXT2FS_COMPILER_H
2 #define _EXT2FS_COMPILER_H
9 #if defined(__GNUC__) && defined(__GNUC_MINOR__)
10 #define __GNUC_PREREQ(maj, min) \
11 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
13 #define __GNUC_PREREQ(maj, min) 0
17 #define container_of(ptr, type, member) ({ \
18 __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
19 (type *)( (char *)__mptr - offsetof(type,member) );})
21 #define container_of(ptr, type, member) \
22 ((type *)((char *)(ptr) - offsetof(type, member)))
26 #endif /* _EXT2FS_COMPILER_H */