Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
3.9 KiB

  1. /***
  2. *limits.h - implementation dependent values
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Contains defines for a number of implementation dependent values
  8. * which are commonly used in C programs.
  9. * [ANSI]
  10. *
  11. * [Public]
  12. *
  13. ****/
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifndef _INC_LIMITS
  18. #define _INC_LIMITS
  19. #if !defined(_WIN32)
  20. #error ERROR: Only Win32 target supported!
  21. #endif
  22. #define CHAR_BIT 8 /* number of bits in a char */
  23. #define SCHAR_MIN (-128) /* minimum signed char value */
  24. #define SCHAR_MAX 127 /* maximum signed char value */
  25. #define UCHAR_MAX 0xff /* maximum unsigned char value */
  26. #ifndef _CHAR_UNSIGNED
  27. #define CHAR_MIN SCHAR_MIN /* mimimum char value */
  28. #define CHAR_MAX SCHAR_MAX /* maximum char value */
  29. #else
  30. #define CHAR_MIN 0
  31. #define CHAR_MAX UCHAR_MAX
  32. #endif /* _CHAR_UNSIGNED */
  33. #define MB_LEN_MAX 5 /* max. # bytes in multibyte char */
  34. #define SHRT_MIN (-32768) /* minimum (signed) short value */
  35. #define SHRT_MAX 32767 /* maximum (signed) short value */
  36. #define USHRT_MAX 0xffff /* maximum unsigned short value */
  37. #define INT_MIN (-2147483647 - 1) /* minimum (signed) int value */
  38. #define INT_MAX 2147483647 /* maximum (signed) int value */
  39. #define UINT_MAX 0xffffffff /* maximum unsigned int value */
  40. #define LONG_MIN (-2147483647L - 1) /* minimum (signed) long value */
  41. #define LONG_MAX 2147483647L /* maximum (signed) long value */
  42. #define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */
  43. #if _INTEGRAL_MAX_BITS >= 8
  44. #define _I8_MIN (-127i8 - 1) /* minimum signed 8 bit value */
  45. #define _I8_MAX 127i8 /* maximum signed 8 bit value */
  46. #define _UI8_MAX 0xffui8 /* maximum unsigned 8 bit value */
  47. #endif
  48. #if _INTEGRAL_MAX_BITS >= 16
  49. #define _I16_MIN (-32767i16 - 1) /* minimum signed 16 bit value */
  50. #define _I16_MAX 32767i16 /* maximum signed 16 bit value */
  51. #define _UI16_MAX 0xffffui16 /* maximum unsigned 16 bit value */
  52. #endif
  53. #if _INTEGRAL_MAX_BITS >= 32
  54. #define _I32_MIN (-2147483647i32 - 1) /* minimum signed 32 bit value */
  55. #define _I32_MAX 2147483647i32 /* maximum signed 32 bit value */
  56. #define _UI32_MAX 0xffffffffui32 /* maximum unsigned 32 bit value */
  57. #endif
  58. #if _INTEGRAL_MAX_BITS >= 64
  59. /* minimum signed 64 bit value */
  60. #define _I64_MIN (-9223372036854775807i64 - 1)
  61. /* maximum signed 64 bit value */
  62. #define _I64_MAX 9223372036854775807i64
  63. /* maximum unsigned 64 bit value */
  64. #define _UI64_MAX 0xffffffffffffffffui64
  65. #endif
  66. #if _INTEGRAL_MAX_BITS >= 128
  67. /* minimum signed 128 bit value */
  68. #define _I128_MIN (-170141183460469231731687303715884105727i128 - 1)
  69. /* maximum signed 128 bit value */
  70. #define _I128_MAX 170141183460469231731687303715884105727i128
  71. /* maximum unsigned 128 bit value */
  72. #define _UI128_MAX 0xffffffffffffffffffffffffffffffffui128
  73. #endif
  74. #ifdef _POSIX_
  75. #define _POSIX_ARG_MAX 4096
  76. #define _POSIX_CHILD_MAX 6
  77. #define _POSIX_LINK_MAX 8
  78. #define _POSIX_MAX_CANON 255
  79. #define _POSIX_MAX_INPUT 255
  80. #define _POSIX_NAME_MAX 14
  81. #define _POSIX_NGROUPS_MAX 0
  82. #define _POSIX_OPEN_MAX 16
  83. #define _POSIX_PATH_MAX 255
  84. #define _POSIX_PIPE_BUF 512
  85. #define _POSIX_SSIZE_MAX 32767
  86. #define _POSIX_STREAM_MAX 8
  87. #define _POSIX_TZNAME_MAX 3
  88. #define ARG_MAX 14500 /* 16k heap, minus overhead */
  89. #define LINK_MAX 1024
  90. #define MAX_CANON _POSIX_MAX_CANON
  91. #define MAX_INPUT _POSIX_MAX_INPUT
  92. #define NAME_MAX 255
  93. #define NGROUPS_MAX 16
  94. #define OPEN_MAX 32
  95. #define PATH_MAX 512
  96. #define PIPE_BUF _POSIX_PIPE_BUF
  97. #define SSIZE_MAX _POSIX_SSIZE_MAX
  98. #define STREAM_MAX 20
  99. #define TZNAME_MAX 10
  100. #endif /* POSIX */
  101. #endif /* _INC_LIMITS */