mirror of
https://github.com/json-c/json-c.git
synced 2026-04-05 05:19:07 +08:00
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:
@@ -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