git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15103
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
#if defined(__WIN32__) && !defined(__TWIN32__) && !defined(__WXMICROWIN__) && ! (defined(__GNUWIN32__) && !defined(__MINGW32__))
// TODO should use GetComputerNameEx() when available
{
#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 )
{
WSADATA wsa;
if ( WSAStartup(MAKEWORD(1, 1), &wsa) == 0 )
{
{
wxStrncpy(buf, host, maxSize);
return TRUE;
}
}
{
wxStrncpy(buf, host, maxSize);
return TRUE;
}
}
+#endif // wxUSE_SOCKETS
+
#endif // Win32
return wxGetHostName(buf, maxSize);
#endif // Win32
return wxGetHostName(buf, maxSize);