编译选项错误的问题。

This commit is contained in:
魔罗技术 2021-01-17 14:37:04 +08:00
parent e7c891ba14
commit 0d978ff3c2

8
list.h
View File

@ -3,8 +3,9 @@
#include <stddef.h>
#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