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