diff --git a/appveyor.yml b/appveyor.yml index 033854abf..0c13920e7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -53,14 +53,18 @@ environment: # linkflags: '"-LC:\\OpenSSL-Win32\\lib"' install: -- git submodule update --init --recursive +- if defined sim ( git submodule update --init --recursive ) - set ROOT_DIRECTORY=%CD% - cd %ROOT_DIRECTORY% - if %compiler% == msvc-12.0 ( if not exist openssl-1.0.1p-vs2013.7z ( - appveyor DownloadFile http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2013.7z + echo downloading openssl-2013 + & appveyor DownloadFile "http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2013.7z" ) - & 7z x -oc:\ -aoa openssl-1.0.1p-vs2013.7z + ) +- if %compiler% == msvc-12.0 ( + echo extracting openssl-2013 + & 7z x -oc:\ -aoa openssl-1.0.1p-vs2013.7z > nul & copy c:\openssl-1.0.1p-vs2013\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2013\lib64\ssleay32.lib & copy c:\openssl-1.0.1p-vs2013\lib64\libeay32MT.lib c:\openssl-1.0.1p-vs2013\lib64\libeay32.lib & copy c:\openssl-1.0.1p-vs2013\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2013\lib\ssleay32.lib @@ -68,23 +72,31 @@ install: ) - if %compiler% == msvc-10.0 ( if not exist openssl-1.0.1p-vs2010.7z ( - appveyor DownloadFile http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2010.7z + echo downloading openssl-2010 + & appveyor DownloadFile "http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2010.7z" ) - & 7z x -oc:\ -aoa openssl-1.0.1p-vs2010.7z - & copy c:\openssl-1.0.1p-vs2010\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2010\lib64\ssleay32.lib - & copy c:\openssl-1.0.1p-vs2010\lib64\libeay32MT.lib c:\openssl-1.0.1p-vs2010\lib64\libeay32.lib - & copy c:\openssl-1.0.1p-vs2010\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2010\lib\ssleay32.lib - & copy c:\openssl-1.0.1p-vs2010\lib\libeay32MT.lib c:\openssl-1.0.1p-vs2010\lib\libeay32.lib + ) +- if %compiler% == msvc-10.0 ( + echo extracting openssl-2010 + & 7z x -oc:\ -aoa openssl-1.0.1p-vs2010.7z > nul + & copy c:\openssl-1.0.1p-vs2010\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2010\lib64\ssleay32.lib + & copy c:\openssl-1.0.1p-vs2010\lib64\libeay32MT.lib c:\openssl-1.0.1p-vs2010\lib64\libeay32.lib + & copy c:\openssl-1.0.1p-vs2010\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2010\lib\ssleay32.lib + & copy c:\openssl-1.0.1p-vs2010\lib\libeay32MT.lib c:\openssl-1.0.1p-vs2010\lib\libeay32.lib ) - if %compiler% == msvc-14.0 ( if not exist openssl-1.0.1p-vs2015.7z ( - appveyor DownloadFile http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2015.7z + echo downloading openssl-2015 + & appveyor DownloadFile "http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2015.7z" ) - & 7z x -oc:\ -aoa openssl-1.0.1p-vs2015.7z - & copy c:\openssl-1.0.1p-vs2015\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2015\lib64\ssleay32.lib - & copy c:\openssl-1.0.1p-vs2015\lib64\libeay32MT.lib c:\openssl-1.0.1p-vs2015\lib64\libeay32.lib - & copy c:\openssl-1.0.1p-vs2015\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2015\lib\ssleay32.lib - & copy c:\openssl-1.0.1p-vs2015\lib\libeay32MT.lib c:\openssl-1.0.1p-vs2015\lib\libeay32.lib + ) +- if %compiler% == msvc-14.0 ( + echo extracting openssl-2015 + & 7z x -oc:\ -aoa openssl-1.0.1p-vs2015.7z > nul + & copy c:\openssl-1.0.1p-vs2015\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2015\lib64\ssleay32.lib + & copy c:\openssl-1.0.1p-vs2015\lib64\libeay32MT.lib c:\openssl-1.0.1p-vs2015\lib64\libeay32.lib + & copy c:\openssl-1.0.1p-vs2015\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2015\lib\ssleay32.lib + & copy c:\openssl-1.0.1p-vs2015\lib\libeay32MT.lib c:\openssl-1.0.1p-vs2015\lib\libeay32.lib ) - cd %ROOT_DIRECTORY% - set BOOST_ROOT=c:\Libraries\boost diff --git a/include/libtorrent/openssl.hpp b/include/libtorrent/openssl.hpp index e2fff8408..84e38715a 100644 --- a/include/libtorrent/openssl.hpp +++ b/include/libtorrent/openssl.hpp @@ -38,6 +38,11 @@ POSSIBILITY OF SUCH DAMAGE. // all of OpenSSL causes warnings, so we just have to disable them #include "libtorrent/aux_/disable_warnings_push.hpp" +#ifdef TORRENT_WINDOWS +// because openssl includes winsock.h, we must include winsock2.h first +#include +#endif + #include #include // for sk_GENERAL_NAME_value #include // for GENERAL_NAME