From 306929ee80299b274be5fb6fdd3af3481bd02b08 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 29 Dec 2010 23:22:00 +0100 Subject: [PATCH] ssize_t: proper typedef with MSVC compilers As discussed on the mailing list, it was wrong for win64 and using the VC-provided type is the safest approach instead of second- guessing which one it should be. --- include/libssh2.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/libssh2.h b/include/libssh2.h index e011d49..5c33d86 100644 --- a/include/libssh2.h +++ b/include/libssh2.h @@ -87,6 +87,10 @@ #ifdef __cplusplus extern "C" { #endif +#ifdef _MSC_VER +# include +# include +#endif #include #include @@ -121,9 +125,8 @@ typedef unsigned char uint8_t; typedef unsigned int uint32_t; typedef unsigned __int64 libssh2_uint64_t; typedef __int64 libssh2_int64_t; -# ifndef _SSIZE_T_DEFINED -typedef int ssize_t; -# define _SSIZE_T_DEFINED +#ifndef ssize_t +typedef SSIZE_T ssize_t; #endif #else typedef unsigned long long libssh2_uint64_t;