Skip to content

Commit a861839

Browse files
committed
windows: add SSIZE_MAX
Windows doesn't include ssize_t or its _MAX value by default. We are already declaring ssize_t as SSIZE_T, which is __int64_t on Win64 and long otherwise. Include its _MAX value as a correspondence to its type.
1 parent f1986a2 commit a861839

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/win32/msvc-compat.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
typedef unsigned short mode_t;
1313
typedef SSIZE_T ssize_t;
1414

15+
#ifdef _WIN64
16+
# define SSIZE_MAX _I64_MAX
17+
#else
18+
# define SSIZE_MAX LONG_MAX
19+
#endif
20+
1521
#define strcasecmp(s1, s2) _stricmp(s1, s2)
1622
#define strncasecmp(s1, s2, c) _strnicmp(s1, s2, c)
1723

0 commit comments

Comments
 (0)