diff --git a/lib/netplay/netsocket.cpp b/lib/netplay/netsocket.cpp index b449acb9783..f03be08e7e1 100644 --- a/lib/netplay/netsocket.cpp +++ b/lib/netplay/netsocket.cpp @@ -72,7 +72,7 @@ struct Socket SOCKET fd[SOCK_COUNT]; bool ready; - nonstd::optional writeErrorCode; + optional writeErrorCode = nullopt; bool deleteLater; char textAddress[40] = {}; diff --git a/lib/netplay/netsocket.h b/lib/netplay/netsocket.h index a660a744645..01413011cd3 100644 --- a/lib/netplay/netsocket.h +++ b/lib/netplay/netsocket.h @@ -27,6 +27,8 @@ #include #include +using nonstd::optional; +using nonstd::nullopt; #include namespace net @@ -158,7 +160,7 @@ struct OpenConnectionResult void operator()(Socket* b) { if (b) { socketClose(b); } } }; std::unique_ptr open_socket; - nonstd::optional errorCode; + optional errorCode = nullopt; std::string errorString; }; typedef std::function OpenConnectionToHostResultCallback;