mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r13990) -Fix (r13988): win32 compilation failed
This commit is contained in:
parent
7a50ae28d5
commit
0f10939029
@ -7,6 +7,7 @@
|
|||||||
#include "../../stdafx.h"
|
#include "../../stdafx.h"
|
||||||
#include "../../debug.h"
|
#include "../../debug.h"
|
||||||
#include "os_abstraction.h"
|
#include "os_abstraction.h"
|
||||||
|
#include "../../core/alloc_func.hpp"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal implementation for finding the broadcast IPs.
|
* Internal implementation for finding the broadcast IPs.
|
||||||
@ -117,15 +118,15 @@ static int NetworkFindBroadcastIPsInternal(uint32 *broadcast, int limit) // Win3
|
|||||||
if (sock == INVALID_SOCKET) return 0;
|
if (sock == INVALID_SOCKET) return 0;
|
||||||
|
|
||||||
DWORD len = 0;
|
DWORD len = 0;
|
||||||
INTERFACE_INFO ifo[MAX_INTERFACES];
|
INTERFACE_INFO *ifo = AllocaM(INTERFACE_INFO, limit);
|
||||||
memset(&ifo[0], 0, sizeof(ifo));
|
memset(ifo, 0, limit * sizeof(*ifo));
|
||||||
if ((WSAIoctl(sock, SIO_GET_INTERFACE_LIST, NULL, 0, &ifo[0], sizeof(ifo), &len, NULL, NULL)) != 0) {
|
if ((WSAIoctl(sock, SIO_GET_INTERFACE_LIST, NULL, 0, &ifo[0], limit * sizeof(*ifo), &len, NULL, NULL)) != 0) {
|
||||||
closesocket(sock);
|
closesocket(sock);
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (int j = 0; j < len / sizeof(*ifo) && index != limit; j++) {
|
for (uint j = 0; j < len / sizeof(*ifo) && index != limit; j++) {
|
||||||
if (ifo[j].iiFlags & IFF_LOOPBACK) continue;
|
if (ifo[j].iiFlags & IFF_LOOPBACK) continue;
|
||||||
if (!(ifo[j].iiFlags & IFF_BROADCAST)) continue;
|
if (!(ifo[j].iiFlags & IFF_BROADCAST)) continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user