diff --git a/src/compat.h b/src/compat.h index d4dc3ba99..d9253c867 100644 --- a/src/compat.h +++ b/src/compat.h @@ -75,6 +75,12 @@ typedef u_int SOCKET; #define MAX_PATH 1024 #endif +// ssize_t is POSIX, and not present when using MSVC. +#ifdef _MSC_VER +#include +typedef SSIZE_T ssize_t; +#endif + // As Solaris does not have the MSG_NOSIGNAL flag for send(2) syscall, it is defined as 0 #if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL) #define MSG_NOSIGNAL 0 diff --git a/src/random.h b/src/random.h index b35cf51a1..6503d8359 100644 --- a/src/random.h +++ b/src/random.h @@ -121,7 +121,7 @@ public: * sure that the underlying OS APIs for all platforms support the number. * (many cap out at 256 bytes). */ -static const ssize_t NUM_OS_RANDOM_BYTES = 32; +static const int NUM_OS_RANDOM_BYTES = 32; /** Get 32 bytes of system entropy. Do not use this in application code: use * GetStrongRandBytes instead.