mirror of https://github.com/aria2/aria2
Include winsock2.h before windows.h
parent
e760b3bd6e
commit
ce9eec5cb2
|
@ -41,19 +41,6 @@
|
||||||
|
|
||||||
#include <iostream>
|
#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
|
#ifdef HAVE_OPENSSL
|
||||||
# include <openssl/err.h>
|
# include <openssl/err.h>
|
||||||
# include <openssl/ssl.h>
|
# include <openssl/ssl.h>
|
||||||
|
@ -69,6 +56,7 @@
|
||||||
# include <ares.h>
|
# include <ares.h>
|
||||||
#endif // ENABLE_ASYNC_DNS
|
#endif // ENABLE_ASYNC_DNS
|
||||||
|
|
||||||
|
#include "a2netcompat.h"
|
||||||
#include "DlAbortEx.h"
|
#include "DlAbortEx.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "fmt.h"
|
#include "fmt.h"
|
||||||
|
|
|
@ -37,16 +37,6 @@
|
||||||
#include "a2io.h"
|
#include "a2io.h"
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#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
|
# ifdef HAVE_WS2TCPIP_H
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
# endif // HAVE_WS2TCPIP_H
|
# endif // HAVE_WS2TCPIP_H
|
||||||
|
|
14
src/common.h
14
src/common.h
|
@ -51,8 +51,18 @@
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# ifndef WINVER
|
# ifndef WINVER
|
||||||
# define WINVER 0x501u
|
# define WINVER 0x501
|
||||||
# endif // WINVER
|
# 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>
|
# include <windows.h>
|
||||||
#endif // __MINGW32__
|
#endif // __MINGW32__
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue