aboutsummaryrefslogtreecommitdiff
path: root/include/apos/types.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-04-21 23:25:57 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-04-21 23:25:57 +0300
commit42451ed4718af3f93770feb201bd023625d69b3a (patch)
tree7f69bc86e0fc0591f176ca086db377e1cb99a718 /include/apos/types.h
parent1a5248bb177242a34fd51efadb4af941853d5e35 (diff)
downloadkmi-42451ed4718af3f93770feb201bd023625d69b3a.tar.gz
kmi-42451ed4718af3f93770feb201bd023625d69b3a.zip
fix warnings on 32bit riscv
+ Will most probably not work on 32bit, but nice to make 'portable' code.
Diffstat (limited to 'include/apos/types.h')
-rw-r--r--include/apos/types.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/apos/types.h b/include/apos/types.h
index 01c5317..d413957 100644
--- a/include/apos/types.h
+++ b/include/apos/types.h
@@ -37,9 +37,13 @@ typedef __UINT_FAST64_TYPE__ uint_fast64_t;
typedef __INTPTR_TYPE__ intptr_t;
typedef __UINTPTR_TYPE__ uintptr_t;
-/* sort of unconventional, but should be fine */
-typedef uintmax_t size_t;
-typedef intmax_t ssize_t;
+#if __SIZE_WIDTH__ == 64
+typedef uint64_t size_t;
+typedef int64_t ssize_t;
+#else
+typedef uint32_t size_t;
+typedef int32_t ssize_t;
+#endif
#define INT8_C __INT8_C
#define INT16_C __INT16_C