values.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. /* This interface is obsolete. New programs should use
  17. <limits.h> and/or <float.h> instead of <values.h>. */
  18. #ifndef _VALUES_H
  19. #define _VALUES_H 1
  20. #include <features.h>
  21. #include <limits.h>
  22. #define _TYPEBITS(type) (sizeof (type) * CHAR_BIT)
  23. #define CHARBITS _TYPEBITS (char)
  24. #define SHORTBITS _TYPEBITS (short int)
  25. #define INTBITS _TYPEBITS (int)
  26. #define LONGBITS _TYPEBITS (long int)
  27. #define PTRBITS _TYPEBITS (char *)
  28. #define DOUBLEBITS _TYPEBITS (double)
  29. #define FLOATBITS _TYPEBITS (float)
  30. #define MINSHORT SHRT_MIN
  31. #define MININT INT_MIN
  32. #define MINLONG LONG_MIN
  33. #define MAXSHORT SHRT_MAX
  34. #define MAXINT INT_MAX
  35. #define MAXLONG LONG_MAX
  36. #define HIBITS MINSHORT
  37. #define HIBITL MINLONG
  38. #ifdef __UCLIBC_HAS_FLOATS__
  39. #include <float.h>
  40. #define MAXDOUBLE DBL_MAX
  41. #ifdef __UCLIBC_SUSV4_LEGACY__
  42. #define MAXFLOAT FLT_MAX
  43. #endif
  44. #define MINDOUBLE DBL_MIN
  45. #define MINFLOAT FLT_MIN
  46. #define DMINEXP DBL_MIN_EXP
  47. #define FMINEXP FLT_MIN_EXP
  48. #define DMAXEXP DBL_MAX_EXP
  49. #define FMAXEXP FLT_MAX_EXP
  50. #endif /* __UCLIBC_HAS_FLOATS__ */
  51. #ifdef __USE_MISC
  52. /* Some systems define this name instead of CHAR_BIT or CHARBITS. */
  53. # define BITSPERBYTE CHAR_BIT
  54. #endif
  55. #endif /* values.h */