From 458d582ab135c5227551c359e9115a557c36fed9 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 30 Jul 2015 14:26:17 -0400 Subject: [PATCH] Added typedef for missing ssize_t on Windows. We used the same definitions Windows provided for the datatypes on MSDN, so it should not cause compiler problems (at least under Windows compilers) --- config.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config.h b/config.h index 7d2ee7f2..7f943449 100644 --- a/config.h +++ b/config.h @@ -172,6 +172,19 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff); typedef word64 dword; #endif #endif + +// Handle missing ssize_t on Windows. Typedef's taken from: +// https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx#LONG_PTR +#if defined(_WIN32) || defined(_WIN64) +# if defined(_WIN64) + typedef __int64 LONG_PTR; +# else + typedef long LONG_PTR; +# endif + typedef LONG_PTR SSIZE_T; + typedef SSIZE_T ssize_t; +#endif + #ifndef CRYPTOPP_BOOL_SLOW_WORD64 #define CRYPTOPP_BOOL_SLOW_WORD64 0 #endif