Skip to content

Commit

Permalink
rewrite using standard C
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Feb 20, 2017
1 parent a374036 commit 1522a78
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions deps/libgkc/gkc.c
Expand Up @@ -100,9 +100,7 @@ static inline void list_add_tail(struct list *l, struct list *n)
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif

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

struct freelist {
struct freelist *next;
Expand Down

0 comments on commit 1522a78

Please sign in to comment.