X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f5e2134e5b3a59e4b63d6f27289b41e10ad1ca03..ecd69fb6e90d50981b109a6ea965b0d097988eb0:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 24199aca27..9322dcb46e 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -40,6 +40,12 @@ #include "wx/msw/private.h" // includes +#ifdef __GNUWIN32_OLD__ + // apparently we need to include winsock.h to get WSADATA and other stuff + // used in wxGetFullHostName() with the old mingw32 versions + #include +#endif + #include "wx/timer.h" #if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__) @@ -188,7 +194,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) if ( pHostEnt ) { // Windows will use DNS internally now - pHostEnt = gethostbyaddr(pHostEnt->h_addr, 4, PF_INET); + pHostEnt = gethostbyaddr(pHostEnt->h_addr, 4, AF_INET); } if ( pHostEnt ) @@ -877,6 +883,7 @@ bool wxShutdown(wxShutdownFlags wFlags) bOK = ::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken) != 0; +#ifndef __WXWINE__ if ( bOK ) { TOKEN_PRIVILEGES tkp; @@ -895,6 +902,7 @@ bool wxShutdown(wxShutdownFlags wFlags) // Cannot test the return value of AdjustTokenPrivileges. bOK = ::GetLastError() == ERROR_SUCCESS; } +#endif } if ( bOK ) @@ -941,6 +949,15 @@ long wxGetFreeMemory() #endif } +unsigned long wxGetProcessId() +{ +#ifdef __WIN32__ + return ::GetCurrentProcessId(); +#else + return 0; +#endif +} + // Emit a beeeeeep void wxBell() {