From 766bae9d7626bb596fc3b60d2cd5fe5a7fc356db Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 30 Jul 2009 10:45:58 +0200 Subject: Fix build with MSVC. --- include/libssh/priv.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/libssh/priv.h') diff --git a/include/libssh/priv.h b/include/libssh/priv.h index ead6cfc..ffdf8fd 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 +#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 -- cgit