Back to index

glibc  2.9
values.h
Go to the documentation of this file.
00001 /* Old compatibility names for <limits.h> and <float.h> constants.
00002    Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 /* This interface is obsolete.  New programs should use
00021    <limits.h> and/or <float.h> instead of <values.h>.  */
00022 
00023 #ifndef       _VALUES_H
00024 #define       _VALUES_H     1
00025 
00026 #include <features.h>
00027 
00028 #include <limits.h>
00029 
00030 #define _TYPEBITS(type)     (sizeof (type) * CHAR_BIT)
00031 
00032 #define CHARBITS     _TYPEBITS (char)
00033 #define SHORTBITS    _TYPEBITS (short int)
00034 #define INTBITS             _TYPEBITS (int)
00035 #define LONGBITS     _TYPEBITS (long int)
00036 #define PTRBITS             _TYPEBITS (char *)
00037 #define DOUBLEBITS   _TYPEBITS (double)
00038 #define FLOATBITS    _TYPEBITS (float)
00039 
00040 #define MINSHORT     SHRT_MIN
00041 #define       MININT        INT_MIN
00042 #define       MINLONG              LONG_MIN
00043 
00044 #define       MAXSHORT      SHRT_MAX
00045 #define       MAXINT        INT_MAX
00046 #define       MAXLONG              LONG_MAX
00047 
00048 #define HIBITS              MINSHORT
00049 #define HIBITL              MINLONG
00050 
00051 
00052 #include <float.h>
00053 
00054 #define       MAXDOUBLE     DBL_MAX
00055 #define       MAXFLOAT      FLT_MAX
00056 #define       MINDOUBLE     DBL_MIN
00057 #define       MINFLOAT      FLT_MIN
00058 #define       DMINEXP              DBL_MIN_EXP
00059 #define       FMINEXP              FLT_MIN_EXP
00060 #define       DMAXEXP              DBL_MAX_EXP
00061 #define       FMAXEXP              FLT_MAX_EXP
00062 
00063 
00064 #ifdef __USE_MISC
00065 /* Some systems define this name instead of CHAR_BIT or CHARBITS.  */
00066 # define BITSPERBYTE CHAR_BIT
00067 #endif
00068 
00069 #endif /* values.h */