aboutsummaryrefslogtreecommitdiffstats
path: root/include/stdint.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-10-16 19:11:31 +0200
committerMattias Andrée <maandree@operamail.com>2015-10-16 19:11:31 +0200
commit50e120e73e471aad313e11ea57733316e616aa88 (patch)
tree4c4d9362e3da928f04ec50d28eaaacfc23dddf9b /include/stdint.h
parentwhitespace (diff)
downloadslibc-50e120e73e471aad313e11ea57733316e616aa88.tar.gz
slibc-50e120e73e471aad313e11ea57733316e616aa88.tar.bz2
slibc-50e120e73e471aad313e11ea57733316e616aa88.tar.xz
do not assume that size(void*) == size(long)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--include/stdint.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/stdint.h b/include/stdint.h
index 50af12a..038521f 100644
--- a/include/stdint.h
+++ b/include/stdint.h
@@ -342,7 +342,11 @@
/**
* Maximum value of `uintptr_t`.
*/
-# if __LONG_BIT == 32
+# if __PTR_BIT == 8
+# define UINTPTR_MAX UINT8_MAX
+# elif __PTR_BIT == 16
+# define UINTPTR_MAX UINT16_MAX
+# elif __PTR_BIT == 32
# define UINTPTR_MAX UINT32_MAX
# else
# define UINTPTR_MAX UINT64_MAX
@@ -351,7 +355,11 @@
/**
* Maximum value of `intptr_t`.
*/
-# if __LONG_BIT == 32
+# if __PTR_BIT == 8
+# define INTPTR_MAX INT8_MAX
+# elif __PTR_BIT == 16
+# define INTPTR_MAX INT16_MAX
+# elif __PTR_BIT == 32
# define INTPTR_MAX INT32_MAX
# else
# define INTPTR_MAX INT64_MAX