[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] lib: intmax_t and uintmax_t depend on 32/64 bit
From: |
Ekaitz Zarraga |
Subject: |
[PATCH 2/2] lib: intmax_t and uintmax_t depend on 32/64 bit |
Date: |
Tue, 5 Mar 2024 13:17:48 +0100 |
* include/stdint.h(uintmax_t): Make size dependant on arch size.
(intmax_t): Likewise.
---
include/stdint.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/stdint.h b/include/stdint.h
index 321be21c..9dabe569 100644
--- a/include/stdint.h
+++ b/include/stdint.h
@@ -61,8 +61,13 @@ typedef unsigned long long uint64_t;
typedef long long int64_t;
#endif // __SIZEOF_LONG_LONG__ == 8
+#if __i386__ || __arm__ || __riscv_xlen == 32
typedef int intmax_t;
typedef unsigned uintmax_t;
+#elif __x86_64__ || __riscv_xlen == 64
+typedef long intmax_t;
+typedef unsigned long uintmax_t;
+#endif
#include <sys/types.h>
--
2.41.0