Include winsock2.h before windows.h

pull/97/head
Tatsuhiro Tsujikawa 2013-05-25 23:28:28 +09:00
parent e760b3bd6e
commit ce9eec5cb2
3 changed files with 13 additions and 25 deletions

View File

@ -41,19 +41,6 @@
#include <iostream>
#ifdef HAVE_WINSOCK2_H
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x501u
#endif // _WIN32_WINNT
#include <winsock2.h>
#undef ERROR
#ifdef HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
#endif // HAVE_WS2TCPIP_H
#endif // HAVE_WINSOCK2_H
#ifdef HAVE_OPENSSL
# include <openssl/err.h>
# include <openssl/ssl.h>
@ -69,6 +56,7 @@
# include <ares.h>
#endif // ENABLE_ASYNC_DNS
#include "a2netcompat.h"
#include "DlAbortEx.h"
#include "message.h"
#include "fmt.h"

View File

@ -37,16 +37,6 @@
#include "a2io.h"
#ifdef __MINGW32__
# ifndef WINVER
# define WINVER 0x501u
# endif // !WINVER
# ifdef HAVE_WINSOCK2_H
# ifndef FD_SETSIZE
# define FD_SETSIZE 1024
# endif // !FD_SETSIZE
# include <winsock2.h>
# undef ERROR
# endif // HAVE_WINSOCK2_H
# ifdef HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
# endif // HAVE_WS2TCPIP_H

View File

@ -51,8 +51,18 @@
#ifdef __MINGW32__
# define WIN32_LEAN_AND_MEAN
# ifndef WINVER
# define WINVER 0x501u
# endif // WINVER
# define WINVER 0x501
# endif // !WINVER
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x501
# endif // _WIN32_WINNT
# ifdef HAVE_WINSOCK2_H
# ifndef FD_SETSIZE
# define FD_SETSIZE 1024
# endif // !FD_SETSIZE
# include <winsock2.h>
# undef ERROR
# endif // HAVE_WINSOCK2_H
# include <windows.h>
#endif // __MINGW32__