stddef.h 491 B

12345678910111213141516171819202122232425
  1. #ifndef _STDDEF_H
  2. #define _STDDEF_H
  3. #ifdef __cplusplus
  4. #define NULL 0L
  5. #else
  6. #define NULL ((void*)0)
  7. #endif
  8. #define __NEED_ptrdiff_t
  9. #define __NEED_size_t
  10. #define __NEED_wchar_t
  11. #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
  12. #define __NEED_max_align_t
  13. #endif
  14. #include <bits/alltypes.h>
  15. #if __GNUC__ > 3
  16. #define offsetof(type, member) __builtin_offsetof(type, member)
  17. #else
  18. #define offsetof(type, member) ((size_t)( (char *)&(((type *)0)->member) - (char *)0 ))
  19. #endif
  20. #endif