Correct some minor compile pbs with VC++1.52c & VC++4.1

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Patrick Albert
1999-06-14 09:43:38 +00:00
parent 27a9bd487b
commit c0de7af40b
3 changed files with 27 additions and 9 deletions

View File

@@ -341,13 +341,31 @@ long wxExecute(char **argv, bool sync, wxProcess *handler)
bool wxGetFullHostName(wxChar *buf, int maxSize)
{
DWORD nSize = maxSize;
#if defined(__WIN32__) && !defined(__TWIN32__)
DWORD nSize = maxSize ;
if ( !::GetComputerName(buf, &nSize) )
{
wxLogLastError("GetComputerName");
return FALSE;
}
#else
char *sysname;
const char *default_host = "noname";
static const char WX_SECTION[] = "wxWindows";
static const char eHOSTNAME[] = "HostName";
if ((sysname = getenv("SYSTEM_NAME")) == NULL) {
GetProfileString(WX_SECTION, eHOSTNAME, default_host, buf, maxSize - 1);
} else
strncpy(buf, sysname, maxSize - 1);
buf[maxSize] = '\0';
if ( *buf == '\0' )
{
wxLogLastError("GetComputerName");
return FALSE;
}
#endif
return TRUE;
}