Skip to content

Commit 5dfa4e6

Browse files
committed
Fix sign-conversion warning on IN_MULTICAST in socket_addr.cpp
1 parent 254991c commit 5dfa4e6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scripts/scons_helpers/build-3rdparty.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,8 @@ def die(text, *args):
12211221
setattr(ctx, 'res_dir', 'bin/Release')
12221222
download(
12231223
ctx,
1224-
'https://github.com/roc-streaming/openfec/archive/v{ctx.pkg_ver}.tar.gz',
1224+
#'https://github.com/roc-streaming/openfec/archive/v{ctx.pkg_ver}.tar.gz',
1225+
'https://www.jmd-tech.com/public/openfec-mgw-v{ctx.pkg_ver}.tar.gz',
12251226
'openfec_v{ctx.pkg_ver}.tar.gz')
12261227
unpack(ctx,
12271228
'openfec_v{ctx.pkg_ver}.tar.gz',

src/internal_modules/roc_address/target_berkley/roc_address/socket_addr.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,17 @@ int SocketAddr::port() const {
147147
}
148148
}
149149

150+
#ifndef ROC_TARGET_WINDOWS
151+
#define IN_MULTICAST_U(i) IN_MULTICAST(i)
152+
#else
153+
// Defined as (((long)(i) & 0xf0000000) == 0xe0000000) in Windows, causes Wsign-conversion
154+
#define IN_MULTICAST_U(i) (((unsigned long)(i) & 0xf0000000u) == 0xe0000000u)
155+
#endif
156+
150157
bool SocketAddr::is_multicast() const {
151158
switch (saddr_family(saddr_.addr4)) {
152159
case AF_INET:
153-
return IN_MULTICAST(core::ntoh32u(saddr_.addr4.sin_addr.s_addr));
160+
return IN_MULTICAST_U(core::ntoh32u(saddr_.addr4.sin_addr.s_addr));
154161
case AF_INET6:
155162
return IN6_IS_ADDR_MULTICAST(&saddr_.addr6.sin6_addr);
156163
default:

0 commit comments

Comments
 (0)