Skip to content

Commit

Permalink
Reorder header files to include <winsock2.h> before <windows.h>
Browse files Browse the repository at this point in the history
OpenSSL headers include <windows.h>, it seems, so we need to include
<winsock2.h> before any of those.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Feb 6, 2014
1 parent 4251eb1 commit a626788
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
24 changes: 12 additions & 12 deletions openconnect-internal.h
Expand Up @@ -29,6 +29,18 @@

#define __OPENCONNECT_PRIVATE__

#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#include <sys/select.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#endif

#include "openconnect.h"

#if defined(OPENCONNECT_OPENSSL) || defined(DTLS_OPENSSL)
Expand Down Expand Up @@ -58,18 +70,6 @@
#include <sys/types.h>
#include <unistd.h>

#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#include <sys/select.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#endif

#ifdef LIBPROXY_HDR
#include LIBPROXY_HDR
#endif
Expand Down
3 changes: 2 additions & 1 deletion openssl.c
Expand Up @@ -27,6 +27,8 @@
#include <sys/types.h>
#include <ctype.h>

#include "openconnect-internal.h"

#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/engine.h>
Expand All @@ -37,7 +39,6 @@
#include <openssl/x509.h>
#include <openssl/bio.h>

#include "openconnect-internal.h"

int openconnect_sha1(unsigned char *result, void *data, int len)
{
Expand Down

0 comments on commit a626788

Please sign in to comment.