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 829B

12345678910111213141516171819202122232425262728293031323334
  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. #if ( defined ( __GNUC__ ) && ( __GNUC__ > 3 ) )
  10. #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
  11. #else
  12. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
  13. #endif
  14. #undef container_of
  15. #define container_of(ptr, type, member) ({ \
  16. const typeof( ((type *)0)->member ) *__mptr = (ptr); \
  17. (type *)( (char *)__mptr - offsetof(type,member) );})
  18. /* __WCHAR_TYPE__ is defined by gcc and will change if -fshort-wchar is used */
  19. #ifndef __WCHAR_TYPE__
  20. #define __WCHAR_TYPE__ uint16_t
  21. #endif
  22. #ifndef __WINT_TYPE__
  23. #define __WINT_TYPE__ int
  24. #endif
  25. typedef __WCHAR_TYPE__ wchar_t;
  26. typedef __WINT_TYPE__ wint_t;
  27. #endif /* STDDEF_H */