From f5bdfdde1abe44121a6b2c7d895e63edb5b8f726 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 12 Apr 2023 14:15:56 -0400 Subject: [PATCH] Common/UPnP: Move interface into Common namespace Keeps these utilities consistent with the rest of most of the Common library. --- Source/Core/Common/UPnP.cpp | 4 ++-- Source/Core/Common/UPnP.h | 4 ++-- Source/Core/Core/NetPlayServer.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Core/Common/UPnP.cpp b/Source/Core/Common/UPnP.cpp index 9552236e69..be5474706b 100644 --- a/Source/Core/Common/UPnP.cpp +++ b/Source/Core/Common/UPnP.cpp @@ -164,14 +164,14 @@ static void UnmapPortThread() UnmapPort(s_mapped); } -void UPnP::TryPortmapping(u16 port) +void Common::UPnP::TryPortmapping(u16 port) { if (s_thread.joinable()) s_thread.join(); s_thread = std::thread(&MapPortThread, port); } -void UPnP::StopPortmapping() +void Common::UPnP::StopPortmapping() { if (s_thread.joinable()) s_thread.join(); diff --git a/Source/Core/Common/UPnP.h b/Source/Core/Common/UPnP.h index 3013cf56d2..5545097ec1 100644 --- a/Source/Core/Common/UPnP.h +++ b/Source/Core/Common/UPnP.h @@ -7,10 +7,10 @@ #include "Common/CommonTypes.h" -namespace UPnP +namespace Common::UPnP { void TryPortmapping(u16 port); void StopPortmapping(); -} // namespace UPnP +} // namespace Common::UPnP #endif diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index aa4d97be0e..cf5f5571b9 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -111,7 +111,7 @@ NetPlayServer::~NetPlayServer() } #ifdef USE_UPNP - UPnP::StopPortmapping(); + Common::UPnP::StopPortmapping(); #endif } @@ -168,7 +168,7 @@ NetPlayServer::NetPlayServer(const u16 port, const bool forward_port, NetPlayUI* #ifdef USE_UPNP if (forward_port) - UPnP::TryPortmapping(port); + Common::UPnP::TryPortmapping(port); #endif } }