2005-04-17 02:20:36 +04:00
|
|
|
#ifndef _LINUX_STDDEF_H
|
|
|
|
#define _LINUX_STDDEF_H
|
|
|
|
|
2012-10-13 13:46:48 +04:00
|
|
|
#include <uapi/linux/stddef.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
#undef NULL
|
|
|
|
#define NULL ((void *)0)
|
2006-10-01 10:27:11 +04:00
|
|
|
|
|
|
|
enum {
|
|
|
|
false = 0,
|
|
|
|
true = 1
|
|
|
|
};
|
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
#undef offsetof
|
|
|
|
#ifdef __compiler_offsetof
|
2015-06-26 01:01:16 +03:00
|
|
|
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
|
2005-04-17 02:20:36 +04:00
|
|
|
#else
|
2015-06-26 01:01:16 +03:00
|
|
|
#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
|
2005-04-17 02:20:36 +04:00
|
|
|
#endif
|
2015-03-09 17:52:17 +03: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))
|
2015-06-26 01:01:16 +03:00
|
|
|
|
|
|
|
#endif
|