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

123456789101112131415161718192021222324252627282930
  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__ long int
  21. #endif
  22. typedef __WCHAR_TYPE__ wchar_t;
  23. #endif /* STDDEF_H */