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:
1 parent
34334e5d3f
commit
6465e74020
1 file changed
+3
-3
+3
-3
@@ -41,11 +41,11 @@
|
|||||||
|
|
||||||
#ifndef SSIZE_T_MAX
|
#ifndef SSIZE_T_MAX
|
||||||
#if SIZEOF_SSIZE_T == SIZEOF_INT
|
#if SIZEOF_SSIZE_T == SIZEOF_INT
|
||||||
#define SSIZE_T_MAX UINT_MAX
|
#define SSIZE_T_MAX INT_MAX
|
||||||
#elif SIZEOF_SSIZE_T == SIZEOF_LONG
|
#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
|
#elif SIZEOF_SSIZE_T == SIZEOF_LONG_LONG
|
||||||
#define SSIZE_T_MAX ULLONG_MAX
|
#define SSIZE_T_MAX LLONG_MAX
|
||||||
#else
|
#else
|
||||||
#error Unable to determine size of ssize_t
|
#error Unable to determine size of ssize_t
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in new issue
Block a user