From ee03669517857cedb7aa1f53912d4c5d6cd85f3a Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 11 Jan 2005 14:58:04 +0000 Subject: [PATCH] be nice to msvc 6 --- include/libssh2.h | 8 ++++++++ include/libssh2_priv.h | 4 ++-- include/libssh2_sftp.h | 2 +- src/sftp.c | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/libssh2.h b/include/libssh2.h index 86fb41c9..6a9893bb 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 6ed2587e..e7be143a 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 e99a717e..278331e1 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 f25327e2..4c099c60 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;