limits.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * limits.h - implementation limits
  3. */
  4. /* $Header$ */
  5. #ifndef _LIMITS_HEADER_
  6. #define _LIMITS_HEADER_
  7. /*
  8. ** Define _SIGNED_CHARS_ for machines with signed characters.
  9. ** Define _WORD_32_ for machines with 32 bits integers.
  10. **
  11. ** These defines should probably be set by the compiler when the
  12. ** -vi option is used.
  13. */
  14. #define _SIGNED_CHARS_
  15. #define _WORD_32_
  16. #define CHAR_BIT 8
  17. #define SCHAR_MIN (-127)
  18. #define SCHAR_MAX (+127)
  19. #define UCHAR_MAX 255
  20. #define MB_LEN_MAX 1
  21. #define SHRT_MIN (-32767)
  22. #define SHRT_MAX (+32767)
  23. #define USHRT_MAX 65535
  24. #define LONG_MIN (-2147483647L)
  25. #define LONG_MAX (+2147483647L)
  26. #define ULONG_MAX 4294967295L
  27. #ifdef _SIGNED_CHARS_
  28. #define CHAR_MAX SCHAR_MAX
  29. #define CHAR_MIN SCHAR_MIN
  30. #else /* defined(_UNSIGNED_CHARS_) */
  31. #define CHAR_MAX UCHAR_MAX
  32. #define CHAR_MIN 0
  33. #endif /* _SIGNED_CHARS */
  34. #ifdef _WORD_32_
  35. #define INT_MIN LONG_MIN
  36. #define INT_MAX LONG_MAX
  37. #define UINT_MAX ULONG_MAX
  38. #else /*defined(_WORD_16_)*/
  39. #define INT_MIN SHRT_MIN
  40. #define INT_MAX SHRT_MAX
  41. #define UINT_MAX USHRT_MAX
  42. #endif /* WORD_32_ */
  43. #endif /* _LIMITS_HEADER_ */