Skip to content

Commit 4c79067

Browse files
committed
[WLANWIZ] __REACTOS__ guard around <numeric> as std::iota is broken
1 parent e644ac1 commit 4c79067

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

dll/shellext/wlanwiz/scan.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
#include "main.h"
88

99
#include <algorithm>
10+
#ifndef __REACTOS__
1011
#include <numeric>
11-
#include <string>
12+
#endif
1213
#include <vector>
1314

1415
LRESULT CWlanWizard::OnScanNetworks(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
@@ -103,8 +104,12 @@ LRESULT CWlanWizard::OnScanNetworks(WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
103104
DWORD dwConnectedTo = MAXDWORD;
104105
std::set<DWORD> setDiscoveredAdHocIndexes;
105106
std::set<DWORD> setAPsWithProfiles;
107+
#ifndef __REACTOS__ /* HACK: std::iota misbehaves on MSVC */
106108
std::iota(vecIndexesBySignalQuality.begin(), vecIndexesBySignalQuality.end(), 0);
107-
109+
#else
110+
for (DWORD dw = 0; dw < vecIndexesBySignalQuality.size(); ++dw)
111+
vecIndexesBySignalQuality[dw] = dw + 1;
112+
#endif
108113
/* Sort networks by signal level */
109114
std::sort(vecIndexesBySignalQuality.begin(), vecIndexesBySignalQuality.end(), [&](auto left, auto right)
110115
{
@@ -144,7 +149,7 @@ LRESULT CWlanWizard::OnScanNetworks(WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
144149
}
145150

146151
DPRINT("Discovered %lu access points (%u are known)\n", this->lstWlanNetworks->dwNumberOfItems, setAPsWithProfiles.size());
147-
152+
148153
/* Shift all ad hoc networks to end */
149154
for (const auto& dwAdHocIdx : setDiscoveredAdHocIndexes)
150155
{

0 commit comments

Comments
 (0)