You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stddef.h 618B

1234567891011121314151617181920212223242526
  1. #ifndef STDDEF_H
  2. #define STDDEF_H
  3. FILE_LICENCE ( GPL2_ONLY );
  4. /* for size_t */
  5. #include <stdint.h>
  6. #undef NULL
  7. #define NULL ((void *)0)
  8. #undef offsetof
  9. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
  10. #undef container_of
  11. #define container_of(ptr, type, member) ({ \
  12. const typeof( ((type *)0)->member ) *__mptr = (ptr); \
  13. (type *)( (char *)__mptr - offsetof(type,member) );})
  14. /* __WCHAR_TYPE__ is defined by gcc and will change if -fshort-wchar is used */
  15. #ifndef __WCHAR_TYPE__
  16. #define __WCHAR_TYPE__ long int
  17. #endif
  18. typedef __WCHAR_TYPE__ wchar_t;
  19. #endif /* STDDEF_H */