htcs: fix magic template argument deduction, do Close/Connect/Bind

This commit is contained in:
Michael Scire 2021-02-18 04:15:23 -08:00 committed by SciresM
parent f71943c03a
commit 0c791f2279
8 changed files with 135 additions and 23 deletions

View file

@ -20,4 +20,17 @@ namespace ams::htcs::impl {
s32 ConvertResultToErrorCode(const Result result);
constexpr bool IsValidName(const char *name) {
static_assert(PeerNameBufferLength == PortNameBufferLength);
return util::Strnlen(name, PeerNameBufferLength) < PeerNameBufferLength;
}
constexpr bool IsValidName(const HtcsPeerName &name) {
return IsValidName(name.name);
}
constexpr bool IsValidName(const HtcsPortName &name) {
return IsValidName(name.name);
}
}