values.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Old compatibility names for <limits.h> and <float.h> constants.
  2. Copyright (C) 1995, 1996, 1997 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. <http://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. #ifdef __UCLIBC_HAS_FLOATS__
  38. #include <float.h>
  39. #define MAXDOUBLE DBL_MAX
  40. #ifdef __UCLIBC_SUSV4_LEGACY__
  41. #define MAXFLOAT FLT_MAX
  42. #endif
  43. #define MINDOUBLE DBL_MIN
  44. #define MINFLOAT FLT_MIN
  45. #define DMINEXP DBL_MIN_EXP
  46. #define FMINEXP FLT_MIN_EXP
  47. #define DMAXEXP DBL_MAX_EXP
  48. #define FMAXEXP FLT_MAX_EXP
  49. #endif /* __UCLIBC_HAS_FLOATS__ */
  50. #ifdef __USE_MISC
  51. /* Some systems define this name instead of CHAR_BIT or CHARBITS. */
  52. # define BITSPERBYTE CHAR_BIT
  53. #endif
  54. #endif /* values.h */