Skip to content
/ i2pd Public
forked from PurpleI2P/i2pd

Commit

Permalink
Make Win32NetState compatible with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Vort committed Mar 1, 2023
1 parent a199084 commit 231c02c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Win32/Win32NetState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ void SubscribeToEvents()
if (SUCCEEDED(Result))
{
VARIANT_BOOL IsConnect = VARIANT_FALSE;
#if defined(_MSC_VER)
Result = pNetworkListManager->get_IsConnectedToInternet(&IsConnect);
#else
Result = pNetworkListManager->IsConnectedToInternet(&IsConnect);
#endif
if (SUCCEEDED(Result)) {
i2p::transport::transports.SetOnline (true);
LogPrint(eLogInfo, "NetState: Current state: ", IsConnect == VARIANT_TRUE ? "connected" : "disconnected");
Expand Down
4 changes: 2 additions & 2 deletions build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ if(APPLE)
endif()

if(MSVC)
add_definitions(-DWINVER=0x0501)
add_definitions(-D_WIN32_WINNT=0x0501)
add_definitions(-DWINVER=0x0600)
add_definitions(-D_WIN32_WINNT=0x0600)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wno-unused-parameter -Wno-uninitialized")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pedantic")
Expand Down

0 comments on commit 231c02c

Please sign in to comment.