From 42451ed4718af3f93770feb201bd023625d69b3a Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 21 Apr 2022 23:25:57 +0300 Subject: fix warnings on 32bit riscv + Will most probably not work on 32bit, but nice to make 'portable' code. --- include/apos/types.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/apos/types.h') 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 -- cgit v1.3