Skip to content

Commit

Permalink
uhd: work around namespace pollution in NetBSD-9's <net/if.h> before …
Browse files Browse the repository at this point in the history
…1.282

also needs atomic64.mk on i386
  • Loading branch information
tnn2 committed Mar 27, 2022
1 parent 9ce27a1 commit 6cf40ae
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ham/uhd/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.65 2022/01/10 01:46:37 ryoon Exp $
# $NetBSD: Makefile,v 1.66 2022/03/27 17:03:28 tnn Exp $

DISTNAME= uhd-4.1.0.5
PKGREVISION= 1
Expand Down Expand Up @@ -83,5 +83,6 @@ INSTALLATION_DIRS+= share/uhd/images
.include "../../devel/libusb1/buildlink3.mk"
.include "../../devel/orc/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../mk/atomic64.mk"
.include "../../mk/curses.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
4 changes: 3 additions & 1 deletion ham/uhd/distinfo
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
$NetBSD: distinfo,v 1.30 2022/01/04 17:29:06 adam Exp $
$NetBSD: distinfo,v 1.31 2022/03/27 17:03:28 tnn Exp $

BLAKE2s (uhd-4.1.0.5.tar.gz) = f172a3e30a7e6b81cf79ead0b7a7bb2f34ea55777b94152c2fec267b2f68586a
SHA512 (uhd-4.1.0.5.tar.gz) = 4929ebc8a12bcc0acfe4a64ceafe17387420e2f056e7bb7284a8d7b60d14aba05484b3c033ce63b00c6d9115f570b056df4e2b36e11a2b25079a8c34b1d084af
Size (uhd-4.1.0.5.tar.gz) = 37975618 bytes
SHA1 (patch-CMakeLists.txt) = 16cc883a0bffdb6c3a4733dda7060bd206928d68
SHA1 (patch-lib_transport_nirio_lvbitx_process-lvbitx.py) = 5117c7593c4e92ed6bfb86388cc366c41a1dead7
SHA1 (patch-lib_usrp_mpmd_mpmd__link__if__ctrl__udp.cpp) = f94b2a282161474a0a91f333fd2d733ce7d1d4f3
SHA1 (patch-lib_usrp_mpmd_mpmd__link__if__ctrl__udp.hpp) = 3106d28c4ddc38fd304eb94de5773ff56fed0fd8
30 changes: 30 additions & 0 deletions ham/uhd/patches/patch-lib_usrp_mpmd_mpmd__link__if__ctrl__udp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$NetBSD: patch-lib_usrp_mpmd_mpmd__link__if__ctrl__udp.cpp,v 1.1 2022/03/27 17:03:28 tnn Exp $

work around namespace pollution in NetBSD-9's <net/if.h> before 1.282

--- lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp.orig 2021-12-14 18:37:20.000000000 +0000
+++ lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp
@@ -79,10 +79,10 @@ mpmd_link_if_ctrl_udp::udp_link_info_map
? std::stoul(link_info.at("link_rate"))
: MAX_RATE_1GIGE;
const std::string link_type = link_info.at("type");
- const size_t if_mtu = std::stoul(link_info.at("mtu"));
+ const size_t if_mtu_ = std::stoul(link_info.at("mtu"));
result.emplace(link_info.at("ipv4"),
mpmd_link_if_ctrl_udp::udp_link_info_t{
- udp_port, link_rate, link_type, if_mtu});
+ udp_port, link_rate, link_type, if_mtu_});
}

return result;
@@ -275,8 +275,8 @@ mpmd_link_if_ctrl_udp::mpmd_link_if_ctrl
if (info.link_type == "internal") {
UHD_LOG_TRACE("MPMD::XPORT::UDP",
"MTU for internal interface " << ip_addr << " is "
- << std::to_string(info.if_mtu));
- _mtu = std::min(_mtu, info.if_mtu);
+ << std::to_string(info.if_mtu_));
+ _mtu = std::min(_mtu, info.if_mtu_);
} else {
_mtu = std::min(_mtu, discover_mtu_for_ip(ip_addr));
}
15 changes: 15 additions & 0 deletions ham/uhd/patches/patch-lib_usrp_mpmd_mpmd__link__if__ctrl__udp.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$NetBSD: patch-lib_usrp_mpmd_mpmd__link__if__ctrl__udp.hpp,v 1.1 2022/03/27 17:03:28 tnn Exp $

work around namespace pollution in NetBSD-9's <net/if.h> before 1.282

--- lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp.orig 2021-12-14 18:37:20.000000000 +0000
+++ lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp
@@ -27,7 +27,7 @@ public:
std::string udp_port;
size_t link_rate;
std::string link_type;
- size_t if_mtu;
+ size_t if_mtu_;
};

using udp_link_info_map = std::map<std::string, udp_link_info_t>;

0 comments on commit 6cf40ae

Please sign in to comment.