mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
Merge #14922: windows: Set _WIN32_WINNT to 0x0601 (Windows 7)
0164b0f5cf
build: Remove WINVER pre define in Makefile.leveldb.inlcude (Chun Kuan Lee)d0522ec94e
Drop defunct Windows compat fixes (Ben Woosley)d8a2992067
windows: Call SetProcessDEPPolicy directly (Chun Kuan Lee)1bd9ffdd44
windows: Set _WIN32_WINNT to 0x0601 (Windows 7) (Chun Kuan Lee) Pull request description: The current minimum support Windows version is Vista. So set it to 0x06005a88def8ad/mingw-w64-headers/include/sdkddkver.h (L19)
Tree-SHA512: 38e2afc79426ae547131c8ad3db2e0a7f54a95512f341cfa0c06e4b2fe79521ae67d2795ef96b0192e683e4f1ba6183c010d7b4b8d6b3e68b9bf48c374c59e7d
This commit is contained in:
commit
3a573fd46c
10 changed files with 4 additions and 44 deletions
|
@ -23,6 +23,7 @@
|
||||||
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
<DisableSpecificWarnings>4018;4244;4267;4715;4805;</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4018;4244;4267;4715;4805;</DisableSpecificWarnings>
|
||||||
<TreatWarningAsError>true</TreatWarningAsError>
|
<TreatWarningAsError>true</TreatWarningAsError>
|
||||||
|
<PreprocessorDefinitions>_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -496,7 +496,7 @@ case $host in
|
||||||
AC_MSG_ERROR("windres not found")
|
AC_MSG_ERROR("windres not found")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
|
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601"
|
||||||
LEVELDB_TARGET_FLAGS="-DOS_WINDOWS"
|
LEVELDB_TARGET_FLAGS="-DOS_WINDOWS"
|
||||||
if test "x$CXXFLAGS_overridden" = "xno"; then
|
if test "x$CXXFLAGS_overridden" = "xno"; then
|
||||||
CXXFLAGS="$CXXFLAGS -w"
|
CXXFLAGS="$CXXFLAGS -w"
|
||||||
|
|
|
@ -24,7 +24,7 @@ LEVELDB_CPPFLAGS_INT += -DLEVELDB_ATOMIC_PRESENT
|
||||||
LEVELDB_CPPFLAGS_INT += -D__STDC_LIMIT_MACROS
|
LEVELDB_CPPFLAGS_INT += -D__STDC_LIMIT_MACROS
|
||||||
|
|
||||||
if TARGET_WINDOWS
|
if TARGET_WINDOWS
|
||||||
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1
|
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_WINDOWS -D__USE_MINGW_ANSI_STDIO=1
|
||||||
else
|
else
|
||||||
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_POSIX
|
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_POSIX
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -11,10 +11,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifdef _WIN32_WINNT
|
|
||||||
#undef _WIN32_WINNT
|
|
||||||
#endif
|
|
||||||
#define _WIN32_WINNT 0x0501
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#endif
|
#endif
|
||||||
|
|
11
src/init.cpp
11
src/init.cpp
|
@ -891,16 +891,7 @@ bool AppInitBasicSetup()
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// Enable Data Execution Prevention (DEP)
|
// Enable Data Execution Prevention (DEP)
|
||||||
// Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008
|
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
|
||||||
// A failure is non-critical and needs no further attention!
|
|
||||||
#ifndef PROCESS_DEP_ENABLE
|
|
||||||
// We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7),
|
|
||||||
// which is not correct. Can be removed, when GCCs winbase.h is fixed!
|
|
||||||
#define PROCESS_DEP_ENABLE 0x00000001
|
|
||||||
#endif
|
|
||||||
typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD);
|
|
||||||
PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetProcessDEPPolicy");
|
|
||||||
if (setProcDEPPol != nullptr) setProcDEPPol(PROCESS_DEP_ENABLE);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!SetupNetworking())
|
if (!SetupNetworking())
|
||||||
|
|
11
src/net.cpp
11
src/net.cpp
|
@ -58,17 +58,6 @@ static constexpr int DUMP_PEERS_INTERVAL = 15 * 60;
|
||||||
#define MSG_DONTWAIT 0
|
#define MSG_DONTWAIT 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fix for ancient MinGW versions, that don't have defined these in ws2tcpip.h.
|
|
||||||
// Todo: Can be removed when our pull-tester is upgraded to a modern MinGW version.
|
|
||||||
#ifdef WIN32
|
|
||||||
#ifndef PROTECTION_LEVEL_UNRESTRICTED
|
|
||||||
#define PROTECTION_LEVEL_UNRESTRICTED 10
|
|
||||||
#endif
|
|
||||||
#ifndef IPV6_PROTECTION_LEVEL
|
|
||||||
#define IPV6_PROTECTION_LEVEL 23
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Used to pass flags to the Bind() function */
|
/** Used to pass flags to the Bind() function */
|
||||||
enum BindFlags {
|
enum BindFlags {
|
||||||
BF_NONE = 0,
|
BF_NONE = 0,
|
||||||
|
|
|
@ -80,11 +80,7 @@ bool static LookupIntern(const char *pszName, std::vector<CNetAddr>& vIP, unsign
|
||||||
aiHint.ai_socktype = SOCK_STREAM;
|
aiHint.ai_socktype = SOCK_STREAM;
|
||||||
aiHint.ai_protocol = IPPROTO_TCP;
|
aiHint.ai_protocol = IPPROTO_TCP;
|
||||||
aiHint.ai_family = AF_UNSPEC;
|
aiHint.ai_family = AF_UNSPEC;
|
||||||
#ifdef WIN32
|
|
||||||
aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST;
|
|
||||||
#else
|
|
||||||
aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST;
|
aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST;
|
||||||
#endif
|
|
||||||
struct addrinfo *aiRes = nullptr;
|
struct addrinfo *aiRes = nullptr;
|
||||||
int nErr = getaddrinfo(pszName, nullptr, &aiHint, &aiRes);
|
int nErr = getaddrinfo(pszName, nullptr, &aiHint, &aiRes);
|
||||||
if (nErr)
|
if (nErr)
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifdef _WIN32_WINNT
|
|
||||||
#undef _WIN32_WINNT
|
|
||||||
#endif
|
|
||||||
#define _WIN32_WINNT 0x0501
|
|
||||||
#ifdef _WIN32_IE
|
#ifdef _WIN32_IE
|
||||||
#undef _WIN32_IE
|
#undef _WIN32_IE
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -10,10 +10,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifdef _WIN32_WINNT
|
|
||||||
#undef _WIN32_WINNT
|
|
||||||
#endif
|
|
||||||
#define _WIN32_WINNT 0x0501
|
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
|
|
|
@ -44,11 +44,6 @@
|
||||||
#pragma warning(disable:4717)
|
#pragma warning(disable:4717)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32_WINNT
|
|
||||||
#undef _WIN32_WINNT
|
|
||||||
#endif
|
|
||||||
#define _WIN32_WINNT 0x0501
|
|
||||||
|
|
||||||
#ifdef _WIN32_IE
|
#ifdef _WIN32_IE
|
||||||
#undef _WIN32_IE
|
#undef _WIN32_IE
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue