Skip to content

Commit 3a573fd

Browse files
committed
Merge #14922: windows: Set _WIN32_WINNT to 0x0601 (Windows 7)
0164b0f build: Remove WINVER pre define in Makefile.leveldb.inlcude (Chun Kuan Lee) d0522ec Drop defunct Windows compat fixes (Ben Woosley) d8a2992 windows: Call SetProcessDEPPolicy directly (Chun Kuan Lee) 1bd9ffd 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 0x0600 https://github.com/mirror/mingw-w64/blob/5a88def8ad862ef8f4e5f2e69661bfb2d07f1ce2/mingw-w64-headers/include/sdkddkver.h#L19 Tree-SHA512: 38e2afc79426ae547131c8ad3db2e0a7f54a95512f341cfa0c06e4b2fe79521ae67d2795ef96b0192e683e4f1ba6183c010d7b4b8d6b3e68b9bf48c374c59e7d
2 parents fc21bb4 + 0164b0f commit 3a573fd

File tree

10 files changed

+4
-44
lines changed

10 files changed

+4
-44
lines changed

build_msvc/common.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
2424
<DisableSpecificWarnings>4018;4244;4267;4715;4805;</DisableSpecificWarnings>
2525
<TreatWarningAsError>true</TreatWarningAsError>
26+
<PreprocessorDefinitions>_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2627
</ClCompile>
2728
</ItemDefinitionGroup>
2829
</Project>

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ case $host in
496496
AC_MSG_ERROR("windres not found")
497497
fi
498498

499-
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
499+
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601"
500500
LEVELDB_TARGET_FLAGS="-DOS_WINDOWS"
501501
if test "x$CXXFLAGS_overridden" = "xno"; then
502502
CXXFLAGS="$CXXFLAGS -w"

src/Makefile.leveldb.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ LEVELDB_CPPFLAGS_INT += -DLEVELDB_ATOMIC_PRESENT
2424
LEVELDB_CPPFLAGS_INT += -D__STDC_LIMIT_MACROS
2525

2626
if TARGET_WINDOWS
27-
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1
27+
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_WINDOWS -D__USE_MINGW_ANSI_STDIO=1
2828
else
2929
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_POSIX
3030
endif

src/compat.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
#endif
1212

1313
#ifdef WIN32
14-
#ifdef _WIN32_WINNT
15-
#undef _WIN32_WINNT
16-
#endif
17-
#define _WIN32_WINNT 0x0501
1814
#ifndef WIN32_LEAN_AND_MEAN
1915
#define WIN32_LEAN_AND_MEAN 1
2016
#endif

src/init.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -891,16 +891,7 @@ bool AppInitBasicSetup()
891891
#endif
892892
#ifdef WIN32
893893
// Enable Data Execution Prevention (DEP)
894-
// Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008
895-
// A failure is non-critical and needs no further attention!
896-
#ifndef PROCESS_DEP_ENABLE
897-
// We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7),
898-
// which is not correct. Can be removed, when GCCs winbase.h is fixed!
899-
#define PROCESS_DEP_ENABLE 0x00000001
900-
#endif
901-
typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD);
902-
PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetProcessDEPPolicy");
903-
if (setProcDEPPol != nullptr) setProcDEPPol(PROCESS_DEP_ENABLE);
894+
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
904895
#endif
905896

906897
if (!SetupNetworking())

src/net.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,6 @@ static constexpr int DUMP_PEERS_INTERVAL = 15 * 60;
5858
#define MSG_DONTWAIT 0
5959
#endif
6060

61-
// Fix for ancient MinGW versions, that don't have defined these in ws2tcpip.h.
62-
// Todo: Can be removed when our pull-tester is upgraded to a modern MinGW version.
63-
#ifdef WIN32
64-
#ifndef PROTECTION_LEVEL_UNRESTRICTED
65-
#define PROTECTION_LEVEL_UNRESTRICTED 10
66-
#endif
67-
#ifndef IPV6_PROTECTION_LEVEL
68-
#define IPV6_PROTECTION_LEVEL 23
69-
#endif
70-
#endif
71-
7261
/** Used to pass flags to the Bind() function */
7362
enum BindFlags {
7463
BF_NONE = 0,

src/netbase.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,7 @@ bool static LookupIntern(const char *pszName, std::vector<CNetAddr>& vIP, unsign
8080
aiHint.ai_socktype = SOCK_STREAM;
8181
aiHint.ai_protocol = IPPROTO_TCP;
8282
aiHint.ai_family = AF_UNSPEC;
83-
#ifdef WIN32
84-
aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST;
85-
#else
8683
aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST;
87-
#endif
8884
struct addrinfo *aiRes = nullptr;
8985
int nErr = getaddrinfo(pszName, nullptr, &aiHint, &aiRes);
9086
if (nErr)

src/qt/guiutil.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
#include <util/system.h>
2222

2323
#ifdef WIN32
24-
#ifdef _WIN32_WINNT
25-
#undef _WIN32_WINNT
26-
#endif
27-
#define _WIN32_WINNT 0x0501
2824
#ifdef _WIN32_IE
2925
#undef _WIN32_IE
3026
#endif

src/support/lockedpool.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
#endif
1111

1212
#ifdef WIN32
13-
#ifdef _WIN32_WINNT
14-
#undef _WIN32_WINNT
15-
#endif
16-
#define _WIN32_WINNT 0x0501
1713
#define WIN32_LEAN_AND_MEAN 1
1814
#ifndef NOMINMAX
1915
#define NOMINMAX

src/util/system.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
#pragma warning(disable:4717)
4545
#endif
4646

47-
#ifdef _WIN32_WINNT
48-
#undef _WIN32_WINNT
49-
#endif
50-
#define _WIN32_WINNT 0x0501
51-
5247
#ifdef _WIN32_IE
5348
#undef _WIN32_IE
5449
#endif

0 commit comments

Comments
 (0)