mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 15:40:02 +00:00
UPnP: move variable declaration to where it's used
This commit is contained in:
parent
7ce9f1f984
commit
0e51082bbb
@ -31,8 +31,6 @@ static bool InitUPnP()
|
|||||||
static bool s_inited = false;
|
static bool s_inited = false;
|
||||||
static bool s_error = false;
|
static bool s_error = false;
|
||||||
|
|
||||||
int upnperror = 0;
|
|
||||||
|
|
||||||
// Don't init if already inited
|
// Don't init if already inited
|
||||||
if (s_inited)
|
if (s_inited)
|
||||||
return true;
|
return true;
|
||||||
@ -45,6 +43,7 @@ static bool InitUPnP()
|
|||||||
std::memset(&s_data, 0, sizeof(IGDdatas));
|
std::memset(&s_data, 0, sizeof(IGDdatas));
|
||||||
|
|
||||||
// Find all UPnP devices
|
// Find all UPnP devices
|
||||||
|
int upnperror = 0;
|
||||||
std::unique_ptr<UPNPDev, decltype(&freeUPNPDevlist)> devlist(nullptr, freeUPNPDevlist);
|
std::unique_ptr<UPNPDev, decltype(&freeUPNPDevlist)> devlist(nullptr, freeUPNPDevlist);
|
||||||
#if MINIUPNPC_API_VERSION >= 14
|
#if MINIUPNPC_API_VERSION >= 14
|
||||||
devlist.reset(upnpDiscover(2000, nullptr, nullptr, 0, 0, 2, &upnperror));
|
devlist.reset(upnpDiscover(2000, nullptr, nullptr, 0, 0, 2, &upnperror));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user