Adam Barth | 57eacf5 | 2020-11-04 00:38:09 +0000 | [diff] [blame^] | 1 | #ifndef SYSROOT_VALUES_H_ |
| 2 | #define SYSROOT_VALUES_H_ |
Doug Horn | 1427b6a | 2018-12-11 13:19:16 -0800 | [diff] [blame] | 3 | |
| 4 | #include <limits.h> |
| 5 | |
| 6 | #define CHARBITS (sizeof(char) * 8) |
| 7 | #define SHORTBITS (sizeof(short) * 8) |
| 8 | #define INTBITS (sizeof(int) * 8) |
| 9 | #define LONGBITS (sizeof(long) * 8) |
| 10 | #define PTRBITS (sizeof(char*) * 8) |
| 11 | #define DOUBLEBITS (sizeof(double) * 8) |
| 12 | #define FLOATBITS (sizeof(float) * 8) |
| 13 | |
| 14 | #define MINSHORT SHRT_MIN |
| 15 | #define MININT INT_MIN |
| 16 | #define MINLONG LONG_MIN |
| 17 | |
| 18 | #define MAXSHORT SHRT_MAX |
| 19 | #define MAXINT INT_MAX |
| 20 | #define MAXLONG LONG_MAX |
| 21 | |
| 22 | #define HIBITS MINSHORT |
| 23 | #define HIBITL MINLONG |
| 24 | |
| 25 | #include <float.h> |
| 26 | |
| 27 | #define MAXDOUBLE DBL_MAX |
| 28 | #undef MAXFLOAT |
| 29 | #define MAXFLOAT FLT_MAX |
| 30 | #define MINDOUBLE DBL_MIN |
| 31 | #define MINFLOAT FLT_MIN |
| 32 | #define DMINEXP DBL_MIN_EXP |
| 33 | #define FMINEXP FLT_MIN_EXP |
| 34 | #define DMAXEXP DBL_MAX_EXP |
| 35 | #define FMAXEXP FLT_MAX_EXP |
| 36 | |
| 37 | #define BITSPERBYTE CHAR_BIT |
Adam Barth | 57eacf5 | 2020-11-04 00:38:09 +0000 | [diff] [blame^] | 38 | |
| 39 | #endif // SYSROOT_VALUES_H_ |