Posted to tcl by auriocus at Sat Jun 21 18:14:59 GMT 2014view raw

  1. Apfelkiste:tcc4tcl-0ca36ca558fe0794 chris$ cat /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/5.1/include/limits.h
  2. /*===---- limits.h - Standard header for integer sizes --------------------===*\
  3. *
  4. * Copyright (c) 2009 Chris Lattner
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. *
  24. \*===----------------------------------------------------------------------===*/
  25.  
  26. #ifndef __CLANG_LIMITS_H
  27. #define __CLANG_LIMITS_H
  28.  
  29. /* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
  30. Avert this #include_next madness. */
  31. #if defined __GNUC__ && !defined _GCC_LIMITS_H_
  32. #define _GCC_LIMITS_H_
  33. #endif
  34.  
  35. /* System headers include a number of constants from POSIX in <limits.h>.
  36. Include it if we're hosted. */
  37. #if __STDC_HOSTED__ && \
  38. defined(__has_include_next) && __has_include_next(<limits.h>)
  39. #include_next <limits.h>
  40. #endif
  41.  
  42. /* Many system headers try to "help us out" by defining these. No really, we
  43. know how big each datatype is. */
  44. #undef SCHAR_MIN
  45. #undef SCHAR_MAX
  46. #undef UCHAR_MAX
  47. #undef SHRT_MIN
  48. #undef SHRT_MAX
  49. #undef USHRT_MAX
  50. #undef INT_MIN
  51. #undef INT_MAX
  52. #undef UINT_MAX
  53. #undef LONG_MIN
  54. #undef LONG_MAX
  55. #undef ULONG_MAX
  56.  
  57. #undef CHAR_BIT
  58. #undef CHAR_MIN
  59. #undef CHAR_MAX
  60.  
  61. /* C90/99 5.2.4.2.1 */
  62. #define SCHAR_MAX __SCHAR_MAX__
  63. #define SHRT_MAX __SHRT_MAX__
  64. #define INT_MAX __INT_MAX__
  65. #define LONG_MAX __LONG_MAX__
  66.  
  67. #define SCHAR_MIN (-__SCHAR_MAX__-1)
  68. #define SHRT_MIN (-__SHRT_MAX__ -1)
  69. #define INT_MIN (-__INT_MAX__ -1)
  70. #define LONG_MIN (-__LONG_MAX__ -1L)
  71.  
  72. #define UCHAR_MAX (__SCHAR_MAX__*2 +1)
  73. #define USHRT_MAX (__SHRT_MAX__ *2 +1)
  74. #define UINT_MAX (__INT_MAX__ *2U +1U)
  75. #define ULONG_MAX (__LONG_MAX__ *2UL+1UL)
  76.  
  77. #ifndef MB_LEN_MAX
  78. #define MB_LEN_MAX 1
  79. #endif
  80.  
  81. #define CHAR_BIT __CHAR_BIT__
  82.  
  83. #ifdef __CHAR_UNSIGNED__ /* -funsigned-char */
  84. #define CHAR_MIN 0
  85. #define CHAR_MAX UCHAR_MAX
  86. #else
  87. #define CHAR_MIN SCHAR_MIN
  88. #define CHAR_MAX __SCHAR_MAX__
  89. #endif
  90.  
  91. /* C99 5.2.4.2.1: Added long long.
  92. C++11 18.3.3.2: same contents as the Standard C Library header <limits.h>.
  93. */
  94. #if __STDC_VERSION__ >= 199901 || __cplusplus >= 201103L
  95.  
  96. #undef LLONG_MIN
  97. #undef LLONG_MAX
  98. #undef ULLONG_MAX
  99.  
  100. #define LLONG_MAX __LONG_LONG_MAX__
  101. #define LLONG_MIN (-__LONG_LONG_MAX__-1LL)
  102. #define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
  103. #endif
  104.  
  105. /* LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX are a GNU extension. It's too bad
  106. that we don't have something like #pragma poison that could be used to
  107. deprecate a macro - the code should just use LLONG_MAX and friends.
  108. */
  109. #if defined(__GNU_LIBRARY__) ? defined(__USE_GNU) : !defined(__STRICT_ANSI__)
  110.  
  111. #undef LONG_LONG_MIN
  112. #undef LONG_LONG_MAX
  113. #undef ULONG_LONG_MAX
  114.  
  115. #define LONG_LONG_MAX __LONG_LONG_MAX__
  116. #define LONG_LONG_MIN (-__LONG_LONG_MAX__-1LL)
  117. #define ULONG_LONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
  118. #endif
  119.  
  120. #endif /* __CLANG_LIMITS_H */