mirror of
https://gitee.com/moluo-tech/AT-Command
synced 2025-06-17 16:07:52 +00:00
编译选项错误的问题。
This commit is contained in:
parent
e7c891ba14
commit
0d978ff3c2
8
list.h
8
list.h
@ -3,8 +3,9 @@
|
|||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#define typeof (struct list_head)
|
#if !defined(__GNUC__)
|
||||||
|
#define typeof (struct list_head)
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef offsetof
|
#undef offsetof
|
||||||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
||||||
@ -16,7 +17,8 @@
|
|||||||
* @member: the name of the member within the struct.
|
* @member: the name of the member within the struct.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#if defined(__ICCARM__) || defined(__CC_ARM)
|
|
||||||
|
#if !defined(__GNUC__)
|
||||||
#define container_of(ptr, type, member) ( \
|
#define container_of(ptr, type, member) ( \
|
||||||
(type *)( (char *)(ptr) - offsetof(type,member) ))
|
(type *)( (char *)(ptr) - offsetof(type,member) ))
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user