X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=lib%2Flist%2Flist.h;h=ad562e4cc9bedece8d299893329d084f1abddefd;hp=0174b90e21b281edf4adba6c8bd7ef3d36b2f3e0;hb=HEAD;hpb=0fad1573c93563fcd62c992d73e9d25161b80076 diff --git a/lib/list/list.h b/lib/list/list.h index 0174b90..ad562e4 100644 --- a/lib/list/list.h +++ b/lib/list/list.h @@ -1,6 +1,8 @@ #ifndef _LIST_H #define _LIST_H +#include + struct list_item { struct list_item *prev, *next; }; @@ -9,16 +11,6 @@ struct list { struct list_item head; }; -#ifndef container_of -#define container_of(_ptr, _type, _member) ({ \ - const typeof( ((_type *)0)->_member ) *__mptr = (_ptr); \ - (_type *)( (char *)__mptr - offsetof(_type,_member) );}) -#endif - -#ifndef offsetof -#define offsetof(_type, _member) ((size_t) &((_type *)0)->_member) -#endif - #define list_for_each(_list, _pos) \ for (_pos = (_list)->head.next; _pos != ((_list)->head); _pos = _pos->next)