stddef.h 840 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * stddef.h - common definitions
  3. *
  4. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  5. * See the copyright notice in the ACK home directory, in the file "Copyright".
  6. */
  7. /* $Header$ */
  8. #ifndef _STDDEF_HEADER_
  9. #define _STDDEF_HEADER_
  10. #ifndef NULL
  11. #define NULL 0
  12. #endif /* NULL */
  13. /* ??? cast to char pointer necessary? */
  14. #define offsetof(type, ident) \
  15. (size_t) &(((type *)0)->ident)
  16. #ifndef _TYPE_PTRDIFF_
  17. #define _TYPE_PTRDIFF_
  18. typedef int ptrdiff_t; /* result of substracting two pointers */
  19. #endif /* _TYPE_PTRDIFF_ */
  20. #ifndef _TYPE_SIZE_
  21. #define _TYPE_SIZE_
  22. typedef unsigned int size_t; /* type returned by sizeof */
  23. #endif /* _TYPE_SIZE_ */
  24. #ifndef _TYPE_WCHAR_
  25. #define _TYPE_WCHAR_
  26. typedef char wchar_t; /* type expanded character set */
  27. #endif /* _TYPE_WCHAR_ */
  28. #endif /* _STDEF_HEADER_ */