diff --git a/include/libssh2.h b/include/libssh2.h index 86fb41c..6a9893b 100644 --- a/include/libssh2.h +++ b/include/libssh2.h @@ -58,6 +58,14 @@ #endif #endif +#if _MSC_VER < 1300 +typedef unsigned __int64 libssh2_uint64_t; +typedef __int64 libssh2_int64_t; +#else +typedef unsigned long long libssh2_uint64_t; +typedef long long libssh2_int64_t; +#endif + #define LIBSSH2_VERSION "0.4" #define LIBSSH2_APINO 200412301450 diff --git a/include/libssh2_priv.h b/include/libssh2_priv.h index 6ed2587..e7be143 100644 --- a/include/libssh2_priv.h +++ b/include/libssh2_priv.h @@ -379,9 +379,9 @@ struct _LIBSSH2_MAC_METHOD { void libssh2_session_shutdown(LIBSSH2_SESSION *session); unsigned long libssh2_ntohu32(const unsigned char *buf); -unsigned long long libssh2_ntohu64(const unsigned char *buf); +libssh2_uint64_t libssh2_ntohu64(const unsigned char *buf); void libssh2_htonu32(unsigned char *buf, unsigned long val); -void libssh2_htonu64(unsigned char *buf, unsigned long long val); +void libssh2_htonu64(unsigned char *buf, libssh2_uint64_t val); int libssh2_packet_read(LIBSSH2_SESSION *session, int block); int libssh2_packet_ask_ex(LIBSSH2_SESSION *session, unsigned char packet_type, unsigned char **data, unsigned long *data_len, unsigned long match_ofs, const unsigned char *match_buf, unsigned long match_len, int poll_socket); diff --git a/include/libssh2_sftp.h b/include/libssh2_sftp.h index e99a717..278331e 100644 --- a/include/libssh2_sftp.h +++ b/include/libssh2_sftp.h @@ -82,7 +82,7 @@ struct _LIBSSH2_SFTP_ATTRIBUTES { */ unsigned long flags; - unsigned long long filesize; + libssh2_uint64_t filesize; unsigned long uid, gid; unsigned long permissions; unsigned long atime, mtime; diff --git a/src/sftp.c b/src/sftp.c index f25327e..4c099c6 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -100,7 +100,7 @@ struct _LIBSSH2_SFTP_HANDLE { union _libssh2_sftp_handle_data { struct _libssh2_sftp_handle_file_data { - unsigned long long offset; + libssh2_uint64_t offset; } file; struct _libssh2_sftp_handle_dir_data { unsigned long names_left;