stddef.h 435 B

12345678910111213141516171819202122232425262728
  1. #ifndef _LINUX_STDDEF_H
  2. #define _LINUX_STDDEF_H
  3. #include <linux/compiler.h>
  4. #undef NULL
  5. #if defined(__cplusplus)
  6. #define NULL 0
  7. #else
  8. #define NULL ((void *)0)
  9. #endif
  10. #ifdef __KERNEL__
  11. enum {
  12. false = 0,
  13. true = 1
  14. };
  15. #undef offsetof
  16. #ifdef __compiler_offsetof
  17. #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
  18. #else
  19. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
  20. #endif
  21. #endif /* __KERNEL__ */
  22. #endif