stddef.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef _STDDEF_H
  2. #define _STDDEF_H
  3. typedef __SIZE_TYPE__ size_t;
  4. typedef __PTRDIFF_TYPE__ ssize_t;
  5. typedef __WCHAR_TYPE__ wchar_t;
  6. typedef __PTRDIFF_TYPE__ ptrdiff_t;
  7. typedef __PTRDIFF_TYPE__ intptr_t;
  8. typedef __SIZE_TYPE__ uintptr_t;
  9. #if __STDC_VERSION__ >= 201112L
  10. typedef union { long long __ll; long double __ld; } max_align_t;
  11. #endif
  12. #ifndef NULL
  13. #define NULL ((void*)0)
  14. #endif
  15. #undef offsetof
  16. #define offsetof(type, field) __builtin_offsetof(type, field)
  17. void *alloca(size_t size);
  18. #endif
  19. /* Older glibc require a wint_t from <stddef.h> (when requested
  20. by __need_wint_t, as otherwise stddef.h isn't allowed to
  21. define this type). Note that this must be outside the normal
  22. _STDDEF_H guard, so that it works even when we've included the file
  23. already (without requiring wint_t). Some other libs define _WINT_T
  24. if they've already provided that type, so we can use that as guard.
  25. TCC defines __WINT_TYPE__ for us. */
  26. #if defined (__need_wint_t)
  27. #ifndef _WINT_T
  28. #define _WINT_T
  29. typedef __WINT_TYPE__ wint_t;
  30. #endif
  31. #undef __need_wint_t
  32. #endif