2005-04-17 05:20:36 +07:00
|
|
|
#ifndef _LINUX_STDDEF_H
|
|
|
|
#define _LINUX_STDDEF_H
|
|
|
|
|
2012-10-13 16:46:48 +07:00
|
|
|
#include <uapi/linux/stddef.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2012-03-21 20:08:24 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#undef NULL
|
|
|
|
#define NULL ((void *)0)
|
2006-10-01 13:27:11 +07:00
|
|
|
|
|
|
|
enum {
|
|
|
|
false = 0,
|
|
|
|
true = 1
|
|
|
|
};
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#undef offsetof
|
|
|
|
#ifdef __compiler_offsetof
|
|
|
|
#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
|
|
|
|
#else
|
|
|
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
|
|
|
#endif
|
|
|
|
#endif
|
2015-03-09 21:52:17 +07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* offsetofend(TYPE, MEMBER)
|
|
|
|
*
|
|
|
|
* @TYPE: The type of the structure
|
|
|
|
* @MEMBER: The member within the structure to get the end offset of
|
|
|
|
*/
|
|
|
|
#define offsetofend(TYPE, MEMBER) \
|
|
|
|
(offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER))
|