#include "wx/log.h"
#endif //WX_PRECOMP
+// In some mingws there is a missing extern "C" int the winsock header,
+// so we put it here just to be safe. Note that this must appear _before_
+// #include "wx/msw/private.h" which itself includes <windows.h>, as this
+// one in turn includes <winsock.h> unless we define WIN32_LEAN_AND_MEAN.
+//
+#if defined(__WIN32__) && !defined(__TWIN32__)
+extern "C" {
+ #include <winsock.h> // we use socket functions in wxGetFullHostName()
+}
+#endif
+
#include "wx/msw/private.h" // includes <windows.h>
#include "wx/timer.h"
#include <dir.h>
#endif
-#if defined(__WIN32__) && !defined(__TWIN32__)
- #include <winsock.h> // we use socket functions in wxGetFullHostName()
-#endif
-
// VZ: there is some code using NetXXX() functions to get the full user name:
// I don't think it's a good idea because they don't work under Win95 and
// seem to return the same as wxGetUserId() under NT. If you really want
// get full hostname (with domain name if possible)
bool wxGetFullHostName(wxChar *buf, int maxSize)
{
-// This breaks _at least_ mingw!!
-#if 0
-
#if defined(__WIN32__) && !defined(__TWIN32__)
// TODO should use GetComputerNameEx() when available
WSADATA wsa;
}
#endif // Win32
-#endif // 0
-
return wxGetHostName(buf, maxSize);
}