summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libssh/priv.h15
-rw-r--r--include/libssh/sftp.h18
2 files changed, 29 insertions, 4 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index ead6cfc3..ffdf8fd7 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -29,6 +29,13 @@
#ifndef _LIBSSH_PRIV_H
#define _LIBSSH_PRIV_H
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#else
+#include <unistd.h>
+#endif
+
#include "config.h"
#include "libssh/libssh.h"
@@ -172,13 +179,19 @@ void hmac_final(HMACCTX ctx,unsigned char *hashmacbuf,unsigned int *len);
/* strings and buffers */
/* must be 32 bits number + immediatly our data */
+#ifdef _MSC_VER
+#pragma pack(1)
+#endif
struct ssh_string_struct {
uint32_t size;
unsigned char string[MAX_PACKET_LEN];
}
-#if !defined(__SUNPRO_C)
+#if !defined(__SUNPRO_C) && !defined(_MSC_VER)
__attribute__ ((packed))
#endif
+#ifdef _MSC_VER
+#pragma pack()
+#endif
;
/** Describes a buffer state at a moment
diff --git a/include/libssh/sftp.h b/include/libssh/sftp.h
index a41681b8..702dd8e5 100644
--- a/include/libssh/sftp.h
+++ b/include/libssh/sftp.h
@@ -38,7 +38,11 @@
#ifndef SFTP_H
#define SFTP_H
-#include <libssh/libssh.h>
+
+#include <sys/types.h>
+
+#include "libssh.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -51,11 +55,19 @@ extern "C" {
#ifdef _WIN32
#ifndef uid_t
- typedef long uid_t;
+ typedef uint32_t uid_t;
#endif /* uid_t */
#ifndef gid_t
- typedef long gid_t;
+ typedef uint32_t gid_t;
#endif /* gid_t */
+#ifdef _MSC_VER
+#ifndef mode_t
+ typedef uint32_t mode_t;
+#endif /* mode_t */
+#ifndef ssize_t
+ typedef _W64 signed int ssize_t;
+#endif /* ssize_t */
+#endif /* _MSC_VER */
#endif /* _WIN32 */
typedef struct sftp_ext_struct *sftp_ext;