Skip to content

Commit 0dd2842

Browse files
authored
Fix MinGW build warning (#482)
1 parent a701963 commit 0dd2842

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

ixwebsocket/IXDNSLookup.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@
2727

2828
// mingw build quirks
2929
#if defined(_WIN32) && defined(__GNUC__)
30+
#ifndef AI_NUMERICSERV
3031
#define AI_NUMERICSERV NI_NUMERICSERV
32+
#endif
33+
#ifndef AI_ADDRCONFIG
3134
#define AI_ADDRCONFIG LUP_ADDRCONFIG
3235
#endif
36+
#endif
3337

3438
namespace ix
3539
{

ixwebsocket/IXNetSystem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace ix
6969
{
7070
// We must deselect the networkevents from the socket event. Otherwise the
7171
// socket will report states that aren't there.
72-
if (_fd != nullptr && _fd->fd != -1)
72+
if (_fd != nullptr && (int)_fd->fd != -1)
7373
WSAEventSelect(_fd->fd, _event, 0);
7474
WSACloseEvent(_event);
7575
}
@@ -171,7 +171,7 @@ namespace ix
171171
int count = 0;
172172
// WSAWaitForMultipleEvents returns the index of the first signaled event. And to emulate WSAPoll()
173173
// all the signaled events must be processed.
174-
while (socketIndex < socketEvents.size())
174+
while (socketIndex < (int)socketEvents.size())
175175
{
176176
struct pollfd* fd = socketEvents[socketIndex];
177177

@@ -345,7 +345,7 @@ namespace ix
345345
buf[best] = buf[best + 1] = ':';
346346
memmove(buf + best + 2, buf + best + max, i - best - max + 1);
347347
}
348-
if (strlen(buf) < l)
348+
if (strlen(buf) < (size_t)l)
349349
{
350350
strcpy(s, buf);
351351
return s;

ixwebsocket/IXSocketOpenSSL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace
4949
X509_STORE* opensslStore = SSL_CTX_get_cert_store(ssl);
5050

5151
int certificateCount = 0;
52-
while (certificateIterator = CertEnumCertificatesInStore(systemStore, certificateIterator))
52+
while ((certificateIterator = CertEnumCertificatesInStore(systemStore, certificateIterator)))
5353
{
5454
X509* x509 = d2i_X509(NULL,
5555
(const unsigned char**) &certificateIterator->pbCertEncoded,

0 commit comments

Comments
 (0)