nptl: remove sysdep-cancel ASM macros, convert to C
[uclibc-ng.git] / include / values.h
blobe0132e6538be133fe08db6b4dbd853075bb3af85
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.
5 The GNU C Library is free software; you can redistribute it and/or
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.
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
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 /* This interface is obsolete. New programs should use
20 <limits.h> and/or <float.h> instead of <values.h>. */
22 #ifndef _VALUES_H
23 #define _VALUES_H 1
25 #include <features.h>
27 #include <limits.h>
29 #define _TYPEBITS(type) (sizeof (type) * CHAR_BIT)
31 #define CHARBITS _TYPEBITS (char)
32 #define SHORTBITS _TYPEBITS (short int)
33 #define INTBITS _TYPEBITS (int)
34 #define LONGBITS _TYPEBITS (long int)
35 #define PTRBITS _TYPEBITS (char *)
36 #define DOUBLEBITS _TYPEBITS (double)
37 #define FLOATBITS _TYPEBITS (float)
39 #define MINSHORT SHRT_MIN
40 #define MININT INT_MIN
41 #define MINLONG LONG_MIN
43 #define MAXSHORT SHRT_MAX
44 #define MAXINT INT_MAX
45 #define MAXLONG LONG_MAX
47 #define HIBITS MINSHORT
48 #define HIBITL MINLONG
51 #ifdef __UCLIBC_HAS_FLOATS__
52 #include <float.h>
54 #define MAXDOUBLE DBL_MAX
55 #ifdef __UCLIBC_SUSV4_LEGACY__
56 #define MAXFLOAT FLT_MAX
57 #endif
58 #define MINDOUBLE DBL_MIN
59 #define MINFLOAT FLT_MIN
60 #define DMINEXP DBL_MIN_EXP
61 #define FMINEXP FLT_MIN_EXP
62 #define DMAXEXP DBL_MAX_EXP
63 #define FMAXEXP FLT_MAX_EXP
64 #endif /* __UCLIBC_HAS_FLOATS__ */
67 #ifdef __USE_MISC
68 /* Some systems define this name instead of CHAR_BIT or CHARBITS. */
69 # define BITSPERBYTE CHAR_BIT
70 #endif
72 #endif /* values.h */