From 29035f952cdd8917dd1436cb9ee95561ee3f7e0e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 29 Apr 2009 11:40:02 +0000 Subject: [PATCH] Reorder the includes. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@646 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/server.c | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/libssh/server.c b/libssh/server.c index fd13274f..6cf6a78d 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -29,33 +29,40 @@ * @{ */ -#include -#include -#include -#ifdef _WIN32 -#include -#define SOCKOPT_TYPE_ARG4 char - -/* We need to provide hstrerror. Not we can't call the parameter h_errno because it's #defined */ -inline char* hstrerror(int h_errno_val) { - static char text[50]; - snprintf(text,sizeof(text),"gethostbyname error %d\n", h_errno_val); - return text; -} -#else -#include -#include -#include -#define SOCKOPT_TYPE_ARG4 int -#endif #include +#include +#include #include #include +#include + #include "libssh/priv.h" #include "libssh/libssh.h" #include "libssh/server.h" #include "libssh/ssh2.h" +#ifdef _WIN32 + +#include +#define SOCKOPT_TYPE_ARG4 char + +/* We need to provide hstrerror. Not we can't call the parameter h_errno because it's #defined */ +inline char *hstrerror(int h_errno_val) { + static char text[50] = {0}; + + snprintf(text, sizeof(text), "gethostbyname error %d\n", h_errno_val); + + return text; +} +#else /* _WIN32 */ + +#include +#include +#include +#define SOCKOPT_TYPE_ARG4 int + +#endif /* _WIN32 */ + // TODO: must use getaddrinfo static socket_t bind_socket(SSH_BIND *ssh_bind, const char *hostname, int port) {