From: Guillermo Rodriguez Garcia Date: Mon, 20 Mar 2000 13:00:27 +0000 (+0000) Subject: Added extern "C" around winsock and moved it before "wx/msw/private.h" X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/26993c4f64a7551050c597cd5f65e3c7f3066eaa Added extern "C" around winsock and moved it before "wx/msw/private.h" to make it work with mingw (2.95 is buggy) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index ab922173c2..b6bb6443b0 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -36,6 +36,17 @@ #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 , as this +// one in turn includes unless we define WIN32_LEAN_AND_MEAN. +// +#if defined(__WIN32__) && !defined(__TWIN32__) +extern "C" { + #include // we use socket functions in wxGetFullHostName() +} +#endif + #include "wx/msw/private.h" // includes #include "wx/timer.h" @@ -61,10 +72,6 @@ #include #endif -#if defined(__WIN32__) && !defined(__TWIN32__) - #include // 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 @@ -178,9 +185,6 @@ bool wxGetHostName(wxChar *buf, int maxSize) // 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; @@ -220,8 +224,6 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) } #endif // Win32 -#endif // 0 - return wxGetHostName(buf, maxSize); }