diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-04-24 21:47:07 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-06-10 13:54:42 +0200 |
commit | 505d65fc5caedd9643959e96c620676f31b1c92f (patch) | |
tree | bf8aec5f7edd7fc4acebe20e7a03aede35bf604d /include | |
parent | 8bd42496f79ab6d86b6cbcd567599151645fe172 (diff) | |
download | barebox-505d65fc5caedd9643959e96c620676f31b1c92f.tar.gz barebox-505d65fc5caedd9643959e96c620676f31b1c92f.tar.xz |
add *_MAX and *_MIN macros
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h index 4c2a72e262..3df1f7fbfd 100644 --- a/include/common.h +++ b/include/common.h @@ -150,4 +150,17 @@ int run_shell(void); const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) +#define USHORT_MAX ((u16)(~0U)) +#define SHORT_MAX ((s16)(USHORT_MAX>>1)) +#define SHORT_MIN (-SHORT_MAX - 1) +#define INT_MAX ((int)(~0U>>1)) +#define INT_MIN (-INT_MAX - 1) +#define UINT_MAX (~0U) +#define LONG_MAX ((long)(~0UL>>1)) +#define LONG_MIN (-LONG_MAX - 1) +#define ULONG_MAX (~0UL) +#define LLONG_MAX ((long long)(~0ULL>>1)) +#define LLONG_MIN (-LLONG_MAX - 1) +#define ULLONG_MAX (~0ULL) + #endif /* __COMMON_H_ */ |