diff options
author | fanquake <fanquake@gmail.com> | 2022-06-29 12:18:44 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-07-20 13:10:12 +0100 |
commit | f7dc99244c8e78dbd0196f612690efcc449c37dc (patch) | |
tree | 2617a25c1c8175e7a2f1fdbdd86b5a3aa1e5f1a7 /src | |
parent | 3be7ee750fd0d31d6e995140025e0d18e6aa788e (diff) |
compat: document redefining ssize_t when using MSVC
See:
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#ssize_t
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
Diffstat (limited to 'src')
-rw-r--r-- | src/compat/compat.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index 670da9a631..a8e5552c0a 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -77,14 +77,10 @@ typedef unsigned int SOCKET; #define MAX_PATH 1024 #endif +// ssize_t is POSIX, and not present when using MSVC. #ifdef _MSC_VER -#if !defined(ssize_t) -#ifdef _WIN64 -typedef int64_t ssize_t; -#else -typedef int32_t ssize_t; -#endif -#endif +#include <BaseTsd.h> +typedef SSIZE_T ssize_t; #endif // The type of the option value passed to getsockopt & setsockopt |