aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/include/stdint.h
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2009-04-16 18:29:51 +0000
committerJeff Johnston <jjohnstn@redhat.com>2009-04-16 18:29:51 +0000
commit34c5e58ebbfbe728e87b807a4a022af0c34c7580 (patch)
tree9a5b877b0163791a733b12913c7c7d9d027c5527 /newlib/libc/include/stdint.h
parent65f414dc16c64a1f2a31c48868df63424f27ca1e (diff)
downloadnewlib-34c5e58ebbfbe728e87b807a4a022af0c34c7580.zip
newlib-34c5e58ebbfbe728e87b807a4a022af0c34c7580.tar.gz
newlib-34c5e58ebbfbe728e87b807a4a022af0c34c7580.tar.bz2
2009-04-16 Hans-Peter Nilsson <hp@axis.com>
* libc/include/stdint.h (INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX): Define.
Diffstat (limited to 'newlib/libc/include/stdint.h')
-rw-r--r--newlib/libc/include/stdint.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/newlib/libc/include/stdint.h b/newlib/libc/include/stdint.h
index d47b222..2791cd5 100644
--- a/newlib/libc/include/stdint.h
+++ b/newlib/libc/include/stdint.h
@@ -242,6 +242,9 @@ typedef uint64_t uint_least32_t;
#if defined(__PTRDIFF_TYPE__)
typedef signed __PTRDIFF_TYPE__ intptr_t;
typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
+#define INTPTR_MAX PTRDIFF_MAX
+#define INTPTR_MIN PTRDIFF_MIN
+#define UINTPTR_MAX (2UL * PTRDIFF_MAX + 1)
#else
/*
* Fallback to hardcoded values,
@@ -249,6 +252,9 @@ typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
*/
typedef signed long intptr_t;
typedef unsigned long uintptr_t;
+#define INTPTR_MAX __STDINT_EXP(LONG_MAX)
+#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
+#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
#endif
/* Limits of Specified-Width Integer Types */