diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-07-30 10:45:58 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-07-30 10:45:58 +0200 |
commit | 766bae9d7626bb596fc3b60d2cd5fe5a7fc356db (patch) | |
tree | ec6aa6d9ea44d8eea5c47a8d1245c4fbe2930d96 /libssh/options.c | |
parent | 94a57df0c9eceda18679b2823de74837fb5a73c1 (diff) | |
download | libssh-766bae9d7626bb596fc3b60d2cd5fe5a7fc356db.tar.gz libssh-766bae9d7626bb596fc3b60d2cd5fe5a7fc356db.tar.xz libssh-766bae9d7626bb596fc3b60d2cd5fe5a7fc356db.zip |
Fix build with MSVC.
Diffstat (limited to 'libssh/options.c')
-rw-r--r-- | libssh/options.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libssh/options.c b/libssh/options.c index bbc985b..4e22b77 100644 --- a/libssh/options.c +++ b/libssh/options.c @@ -24,10 +24,11 @@ #include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <string.h> #ifndef _WIN32 #include <pwd.h> +#else +#include <winsock2.h> #endif #include <sys/types.h> #include "libssh/priv.h" @@ -589,6 +590,7 @@ int ssh_options_default_username(SSH_OPTIONS *opt) { return 0; } #else +{ DWORD Size = 0; GetUserName(NULL, &Size); //Get Size user = malloc(Size); @@ -601,6 +603,7 @@ int ssh_options_default_username(SSH_OPTIONS *opt) { } else { SAFE_FREE(user); } +} #endif return -1; } @@ -836,7 +839,10 @@ int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv) { int ssh1 = 0; #endif int ssh2 = 1; - +#ifdef _MSC_VER + /* Not supported with a Microsoft compiler */ + return -1; +#else int saveoptind = optind; /* need to save 'em */ int saveopterr = opterr; @@ -985,6 +991,7 @@ int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv) { } return 0; +#endif } /** |