forked from premiere/premiere-libtorrent
wrap inclusion of windows.h with appropriate defines
This commit is contained in:
parent
1f9178f882
commit
50ae1838e6
|
@ -218,6 +218,7 @@ nobase_include_HEADERS = \
|
||||||
aux_/torrent_impl.hpp \
|
aux_/torrent_impl.hpp \
|
||||||
aux_/instantiate_connection.hpp \
|
aux_/instantiate_connection.hpp \
|
||||||
aux_/range.hpp \
|
aux_/range.hpp \
|
||||||
|
aux_/windows.hpp \
|
||||||
\
|
\
|
||||||
extensions/smart_ban.hpp \
|
extensions/smart_ban.hpp \
|
||||||
extensions/ut_metadata.hpp \
|
extensions/ut_metadata.hpp \
|
||||||
|
|
|
@ -48,10 +48,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
// windows part
|
// windows part
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#include "libtorrent/aux_/windows.hpp"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -36,9 +36,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/config.hpp"
|
#include "libtorrent/config.hpp"
|
||||||
#include "libtorrent/error_code.hpp"
|
#include "libtorrent/error_code.hpp"
|
||||||
#include "libtorrent/aux_/throw.hpp"
|
#include "libtorrent/aux_/throw.hpp"
|
||||||
|
#include "libtorrent/aux_/windows.hpp"
|
||||||
|
|
||||||
#include "libtorrent/aux_/disable_warnings_push.hpp"
|
#include "libtorrent/aux_/disable_warnings_push.hpp"
|
||||||
#include <windows.h>
|
|
||||||
#include <wincrypt.h>
|
#include <wincrypt.h>
|
||||||
#include "libtorrent/aux_/disable_warnings_pop.hpp"
|
#include "libtorrent/aux_/disable_warnings_pop.hpp"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (c) 2018, Arvid Norberg, Steven Siloti
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the author nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TORRENT_WINDOWS_HPP_INCLUDED
|
||||||
|
#define TORRENT_WINDOWS_HPP_INCLUDED
|
||||||
|
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
#ifndef VC_EXTRALEAN
|
||||||
|
#define VC_EXTRALEAN
|
||||||
|
#endif
|
||||||
|
#ifndef STRICT
|
||||||
|
#define STRICT
|
||||||
|
#endif
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#endif // TORRENT_WINDOWS_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,10 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
// windows part
|
// windows part
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#include "libtorrent/aux_/windows.hpp"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
// windows.h must be included after stdlib.h under mingw
|
// windows.h must be included after stdlib.h under mingw
|
||||||
#include <windows.h>
|
#include "libtorrent/aux_/windows.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TORRENT_MINGW
|
#ifdef TORRENT_MINGW
|
||||||
|
|
|
@ -70,10 +70,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#endif // TORRENT_USE_SYSCTL
|
#endif // TORRENT_USE_SYSCTL
|
||||||
|
|
||||||
#if TORRENT_USE_GETIPFORWARDTABLE || TORRENT_USE_GETADAPTERSADDRESSES
|
#if TORRENT_USE_GETIPFORWARDTABLE || TORRENT_USE_GETADAPTERSADDRESSES
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#include "libtorrent/aux_/windows.hpp"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -39,10 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#include "libtorrent/aux_/windows.hpp"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TORRENT_USE_ICONV
|
#if TORRENT_USE_ICONV
|
||||||
|
|
|
@ -90,10 +90,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/utf8.hpp"
|
#include "libtorrent/utf8.hpp"
|
||||||
#include "libtorrent/aux_/win_util.hpp"
|
#include "libtorrent/aux_/win_util.hpp"
|
||||||
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#include "libtorrent/aux_/windows.hpp"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
#ifndef TORRENT_MINGW
|
#ifndef TORRENT_MINGW
|
||||||
#include <direct.h> // for _getcwd, _mkdir
|
#include <direct.h> // for _getcwd, _mkdir
|
||||||
|
|
|
@ -55,7 +55,7 @@ const rlim_t rlim_infinity = RLIM_INFINITY;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined TORRENT_WINDOWS
|
#if defined TORRENT_WINDOWS
|
||||||
#include <windows.h>
|
#include "libtorrent/aux_/windows.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "libtorrent/aux_/disable_warnings_pop.hpp"
|
#include "libtorrent/aux_/disable_warnings_pop.hpp"
|
||||||
|
|
|
@ -51,7 +51,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h> // fot SetErrorMode
|
#include "libtorrent/aux_/windows.hpp" // fot SetErrorMode
|
||||||
#include <io.h> // for _dup and _dup2
|
#include <io.h> // for _dup and _dup2
|
||||||
#include <process.h> // for _getpid
|
#include <process.h> // for _getpid
|
||||||
#include <crtdbg.h>
|
#include <crtdbg.h>
|
||||||
|
|
Loading…
Reference in New Issue