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. --- libssh/misc.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'libssh/misc.c') diff --git a/libssh/misc.c b/libssh/misc.c index 0df1146..03fd3c3 100644 --- a/libssh/misc.c +++ b/libssh/misc.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -33,8 +32,8 @@ #ifdef _WIN32 #define _WIN32_IE 0x0400 //SHGetSpecialFolderPath +#include // Must be the first to include #include -#include #else #include #include @@ -67,7 +66,6 @@ * @{ */ #ifdef _WIN32 - char *ssh_get_user_home_dir(void) { static char szPath[MAX_PATH] = {0}; @@ -77,7 +75,7 @@ char *ssh_get_user_home_dir(void) { return NULL; } - + /* we have read access on file */ int ssh_file_readaccess_ok(const char *file) { if (_access(file, 4) < 0) { @@ -85,9 +83,8 @@ char *ssh_get_user_home_dir(void) { } return 1; -} +} #else /* _WIN32 */ - char *ssh_get_user_home_dir(void) { static char szPath[PATH_MAX] = {0}; struct passwd *pwd = NULL; @@ -102,8 +99,6 @@ char *ssh_get_user_home_dir(void) { return szPath; } -#endif - /* we have read access on file */ int ssh_file_readaccess_ok(const char *file) { if (access(file, R_OK) < 0) { @@ -112,13 +107,14 @@ int ssh_file_readaccess_ok(const char *file) { return 1; } +#endif uint64_t ntohll(uint64_t a) { #ifdef WORDS_BIGENDIAN return a; #else - uint32_t low = a & 0xffffffff; - uint32_t high = a >> 32 ; + uint32_t low = (uint32_t)(a & 0xffffffff); + uint32_t high = (uint32_t)(a >> 32); low = ntohl(low); high = ntohl(high); -- cgit