summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Vargas <roberto.vargas@arm.com>2018-04-18 11:05:09 +0100
committerSandrine Bailleux <sandrine.bailleux@arm.com>2018-04-18 12:12:04 +0100
commit7a74754db523854f28558fbad79a9dcb68d4afe7 (patch)
tree6b7c5011d3b395630867540a12e57eade130dd33
parent63ae06cec4b5e7e1010e638bc407e98ad2bf8020 (diff)
Define stdint.h types for 32 bits
Stdint.h was defining the limits for fixed size c99 types without worrying about 32 or 64 bits. Change-Id: Iea4e55e6c581e702209fed93fb2150a11d7d6b8b Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
-rw-r--r--include/stdlib/machine/_stdint.h41
1 files changed, 32 insertions, 9 deletions
diff --git a/include/stdlib/machine/_stdint.h b/include/stdlib/machine/_stdint.h
index 9a4f35f..d8f38ff 100644
--- a/include/stdlib/machine/_stdint.h
+++ b/include/stdlib/machine/_stdint.h
@@ -122,7 +122,15 @@
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
+/*
+ * ISO/IEC 9899:1999
+ * 7.18.2.5 Limits of greatest-width integer types
+ */
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+#ifdef AARCH64
/*
* ISO/IEC 9899:1999
* 7.18.2.4 Limits of integer types capable of holding object pointers
@@ -133,27 +141,42 @@
/*
* ISO/IEC 9899:1999
- * 7.18.2.5 Limits of greatest-width integer types
+ * 7.18.3 Limits of other integer types
*/
-#define INTMAX_MIN INT64_MIN
-#define INTMAX_MAX INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
+/* Limits of ptrdiff_t. */
+#define PTRDIFF_MIN INT64_MIN
+#define PTRDIFF_MAX INT64_MAX
+
+/* Limit of size_t. */
+#define SIZE_MAX UINT64_MAX
+
+#else /* AARCH32 */
+/*
+ * ISO/IEC 9899:1999
+ * 7.18.2.4 Limits of integer types capable of holding object pointers
+ */
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+#define UINTPTR_MAX UINT32_MAX
/*
* ISO/IEC 9899:1999
* 7.18.3 Limits of other integer types
*/
/* Limits of ptrdiff_t. */
-#define PTRDIFF_MIN INT64_MIN
-#define PTRDIFF_MAX INT64_MAX
+#define PTRDIFF_MIN INT32_MIN
+#define PTRDIFF_MAX INT32_MAX
+
+/* Limit of size_t. */
+#define SIZE_MAX UINT32_MAX
+
+#endif /* AARCH64 */
+
/* Limits of sig_atomic_t. */
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
-/* Limit of size_t. */
-#define SIZE_MAX UINT64_MAX
-
#ifndef WCHAR_MIN /* Also possibly defined in <wchar.h> */
/* Limits of wchar_t. */
#define WCHAR_MIN INT32_MIN