values.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Old compatibility names for <limits.h> and <float.h> constants.
  2. Copyright (C) 1995-2020 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. /* This interface is obsolete. New programs should use
  16. <limits.h> and/or <float.h> instead of <values.h>. */
  17. #ifndef _VALUES_H
  18. #define _VALUES_H 1
  19. #include <features.h>
  20. #include <limits.h>
  21. #define _TYPEBITS(type) (sizeof (type) * CHAR_BIT)
  22. #define CHARBITS _TYPEBITS (char)
  23. #define SHORTBITS _TYPEBITS (short int)
  24. #define INTBITS _TYPEBITS (int)
  25. #define LONGBITS _TYPEBITS (long int)
  26. #define PTRBITS _TYPEBITS (char *)
  27. #define DOUBLEBITS _TYPEBITS (double)
  28. #define FLOATBITS _TYPEBITS (float)
  29. #define MINSHORT SHRT_MIN
  30. #define MININT INT_MIN
  31. #define MINLONG LONG_MIN
  32. #define MAXSHORT SHRT_MAX
  33. #define MAXINT INT_MAX
  34. #define MAXLONG LONG_MAX
  35. #define HIBITS MINSHORT
  36. #define HIBITL MINLONG
  37. #include <float.h>
  38. #define MAXDOUBLE DBL_MAX
  39. #define MAXFLOAT FLT_MAX
  40. #define MINDOUBLE DBL_MIN
  41. #define MINFLOAT FLT_MIN
  42. #define DMINEXP DBL_MIN_EXP
  43. #define FMINEXP FLT_MIN_EXP
  44. #define DMAXEXP DBL_MAX_EXP
  45. #define FMAXEXP FLT_MAX_EXP
  46. #ifdef __USE_MISC
  47. /* Some systems define this name instead of CHAR_BIT or CHARBITS. */
  48. # define BITSPERBYTE CHAR_BIT
  49. #endif
  50. #endif /* values.h */