From 0d978ff3c2cf9bf79be4dac073f970cef116d0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=94=E7=BD=97=E6=8A=80=E6=9C=AF?= Date: Sun, 17 Jan 2021 14:37:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/list.h b/list.h index 1511b51..0810c23 100644 --- a/list.h +++ b/list.h @@ -3,8 +3,9 @@ #include -#define typeof (struct list_head) - +#if !defined(__GNUC__) + #define typeof (struct list_head) +#endif #undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) @@ -16,7 +17,8 @@ * @member: the name of the member within the struct. * */ -#if defined(__ICCARM__) || defined(__CC_ARM) + +#if !defined(__GNUC__) #define container_of(ptr, type, member) ( \ (type *)( (char *)(ptr) - offsetof(type,member) )) #else