X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/142b3bc26a6e93f5857bc053c7748b2c845c4a8e..19e30148e18cc99296b26503c155e5cef59045f4:/src/msw/utils.cpp?ds=sidebyside diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 117a19c12d..2256d8fc5e 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -178,6 +178,11 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) { #if defined(__WIN32__) && !defined(__TWIN32__) && !defined(__WXMICROWIN__) && ! (defined(__GNUWIN32__) && !defined(__MINGW32__)) // TODO should use GetComputerNameEx() when available + + // the idea is that if someone had set wxUSE_SOCKETS to 0 the code + // shouldn't use winsock.dll (a.k.a. ws2_32.dll) at all so only use this + // code if we link with it anyhow +#if wxUSE_SOCKETS WSADATA wsa; if ( WSAStartup(MAKEWORD(1, 1), &wsa) == 0 ) { @@ -206,13 +211,15 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) WSACleanup(); - if ( !!host ) + if ( !host.empty() ) { wxStrncpy(buf, host, maxSize); return TRUE; } } +#endif // wxUSE_SOCKETS + #endif // Win32 return wxGetHostName(buf, maxSize);