1
0

stddef.h 547 B

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