Merge pull request #2461 from jacquesg/ssh2-warnings Fix SSH2 warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 9440726..1df264e 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -69,7 +69,7 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE LIBSSH2_USERAUTH_KBDINT_RESPONS
#endif
typedef int (*git_cred_sign_callback)(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract);
-typedef int (*git_cred_ssh_interactive_callback)(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract);
+typedef void (*git_cred_ssh_interactive_callback)(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract);
/**
* A ssh key from disk
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 79a632b..a1081b3 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -5,6 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#ifdef GIT_SSH
+#include <libssh2.h>
+#endif
+
#include "git2.h"
#include "buffer.h"
#include "netops.h"
@@ -12,8 +16,6 @@
#ifdef GIT_SSH
-#include <libssh2.h>
-
#define OWNING_SUBTRANSPORT(s) ((ssh_subtransport *)(s)->parent.subtransport)
static const char prefix_ssh[] = "ssh://";