diff options
author | rofl0r <retnyg@gmx.net> | 2013-01-04 13:05:42 +0100 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2013-01-04 20:36:34 +0100 |
commit | 2ba3f44db51a816d3f89ca64d8943a3bee03fa5f (patch) | |
tree | 739e0039558f9e3966eee8bf88f21688815958cf /include/values.h | |
parent | 87781ac64ce5fcd68fb2cf32a3b4305a807e6367 (diff) | |
download | musl-2ba3f44db51a816d3f89ca64d8943a3bee03fa5f.tar.gz musl-2ba3f44db51a816d3f89ca64d8943a3bee03fa5f.tar.bz2 musl-2ba3f44db51a816d3f89ca64d8943a3bee03fa5f.tar.xz musl-2ba3f44db51a816d3f89ca64d8943a3bee03fa5f.zip |
add legacy header values.h
some programs (procps, babl) expect it, and it doesn't seem to
cause any harm to just add it.
it's small and straightforward.
since math.h also defines MAXFLOAT, we undef it in both places,
before defining it.
Diffstat (limited to 'include/values.h')
-rw-r--r-- | include/values.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/values.h b/include/values.h new file mode 100644 index 00000000..fe4949f8 --- /dev/null +++ b/include/values.h @@ -0,0 +1,39 @@ +#ifndef _VALUES_H +#define _VALUES_H + +#include <limits.h> + +#define CHARBITS (sizeof(char) * 8) +#define SHORTBITS (sizeof(short) * 8) +#define INTBITS (sizeof(int) * 8) +#define LONGBITS (sizeof(long) * 8) +#define PTRBITS (sizeof(char *) * 8) +#define DOUBLEBITS (sizeof(double) * 8) +#define FLOATBITS (sizeof(float) * 8) + +#define MINSHORT SHRT_MIN +#define MININT INT_MIN +#define MINLONG LONG_MIN + +#define MAXSHORT SHRT_MAX +#define MAXINT INT_MAX +#define MAXLONG LONG_MAX + +#define HIBITS MINSHORT +#define HIBITL MINLONG + +#include <float.h> + +#define MAXDOUBLE DBL_MAX +#undef MAXFLOAT +#define MAXFLOAT FLT_MAX +#define MINDOUBLE DBL_MIN +#define MINFLOAT FLT_MIN +#define DMINEXP DBL_MIN_EXP +#define FMINEXP FLT_MIN_EXP +#define DMAXEXP DBL_MAX_EXP +#define FMAXEXP FLT_MAX_EXP + +#define BITSPERBYTE CHAR_BIT + +#endif |