values.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #define MAXFLOAT FLT_MAX
  42. #define MINDOUBLE DBL_MIN
  43. #define MINFLOAT FLT_MIN
  44. #define DMINEXP DBL_MIN_EXP
  45. #define FMINEXP FLT_MIN_EXP
  46. #define DMAXEXP DBL_MAX_EXP
  47. #define FMAXEXP FLT_MAX_EXP
  48. #endif /* __UCLIBC_HAS_FLOATS__ */
  49. #ifdef __USE_MISC
  50. /* Some systems define this name instead of CHAR_BIT or CHARBITS. */
  51. # define BITSPERBYTE CHAR_BIT
  52. #endif
  53. #endif /* values.h */