limits.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /****************************************************************************
  2. * arch/x86_64/include/intel64/limits.h
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. #ifndef __ARCH_X86_64_INCLUDE_INTEL64_LIMITS_H
  21. #define __ARCH_X86_64_INCLUDE_INTEL64_LIMITS_H
  22. /****************************************************************************
  23. * Included Files
  24. ****************************************************************************/
  25. /****************************************************************************
  26. * Pre-processor Definitions
  27. ****************************************************************************/
  28. #define CHAR_BIT 8
  29. #define SCHAR_MIN (-SCHAR_MAX - 1)
  30. #define SCHAR_MAX 127
  31. #define UCHAR_MAX 255
  32. /* These could be different on machines where char is unsigned */
  33. #ifdef __CHAR_UNSIGNED__
  34. #define CHAR_MIN 0
  35. #define CHAR_MAX UCHAR_MAX
  36. #else
  37. #define CHAR_MIN SCHAR_MIN
  38. #define CHAR_MAX SCHAR_MAX
  39. #endif
  40. #define SHRT_MIN (-SHRT_MAX - 1)
  41. #define SHRT_MAX 32767
  42. #define USHRT_MAX 65535U
  43. #define INT_MIN (-INT_MAX - 1)
  44. #define INT_MAX 2147483647
  45. #define UINT_MAX 4294967295U
  46. /* For 64-bit x86 with Linux ABI, long is identical to long long */
  47. #define LONG_MIN LLONG_MIN
  48. #define LONG_MAX LLONG_MAX
  49. #define ULONG_MAX ULLONG_MAX
  50. #define LLONG_MIN (-LLONG_MAX - 1)
  51. #define LLONG_MAX 9223372036854775807LL
  52. #define ULLONG_MAX 18446744073709551615ULL
  53. /* A pointer is 8 bytes */
  54. #define PTR_MIN (-PTR_MAX - 1)
  55. #define PTR_MAX LLONG_MAX
  56. #define UPTR_MAX ULLONG_MAX
  57. #endif /* __ARCH_X86_64_INCLUDE_INTEL64_LIMITS_H */