commit 821aa4cf7ca61177b404d57829c501e70bae0933 parent 1840ba4a5841ae98ba66dfa7392578ff19a56296 Author: robert <robertrussell.72001@gmail.com> Date: Fri, 19 Aug 2022 19:11:39 -0700 Simplify search for isize typedef See the comment for rationale. Diffstat:
| M | inc/cext/def.h | | | 16 | +++++----------- |
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/inc/cext/def.h b/inc/cext/def.h @@ -64,17 +64,11 @@ typedef intmax_t imax; typedef intptr_t iptr; /* Avoid dependence on POSIX sys/types.h for ssize_t */ -#if SIZE_MAX == UCHAR_MAX -typedef schar isize; -#elif SIZE_MAX == USHORT_MAX -typedef short isize; -#elif SIZE_MAX == UINT_MAX -typedef int isize; -#elif SIZE_MAX == ULONG_MAX -typedef long isize; -#elif SIZE_MAX == ULLONG_MAX -typedef llong isize; -#else /* I don't think this can happen */ +#if SIZE_MAX == UINT32_MAX +typedef int32_t isize; +#elif SIZE_MAX == UINT64_MAX +typedef int64_t isize; +#else /* This won't happen except on weird archs */ #error "Could not find suitable type for isize" #endif