Use constants referring to the signed integer types when setting SSIZE_T_MAX.

In practice, the sizes of the signed and unsigned integer types will
almost cetainly be the same, but this is more correct.
Pointed out in issue #638.
This commit is contained in:
Eric Haszlakiewicz
2020-07-01 00:34:46 +00:00
parent 34334e5d3f
commit 6465e74020

View File

@@ -41,11 +41,11 @@
#ifndef SSIZE_T_MAX
#if SIZEOF_SSIZE_T == SIZEOF_INT
#define SSIZE_T_MAX UINT_MAX
#define SSIZE_T_MAX INT_MAX
#elif SIZEOF_SSIZE_T == SIZEOF_LONG
#define SSIZE_T_MAX ULONG_MAX
#define SSIZE_T_MAX LONG_MAX
#elif SIZEOF_SSIZE_T == SIZEOF_LONG_LONG
#define SSIZE_T_MAX ULLONG_MAX
#define SSIZE_T_MAX LLONG_MAX
#else
#error Unable to determine size of ssize_t
#endif