Solaris compilation fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -41,8 +41,6 @@
|
|||||||
// so we should use some other strategy!
|
// so we should use some other strategy!
|
||||||
#ifdef __SUN__
|
#ifdef __SUN__
|
||||||
# define DEFAULT_XRESOURCE_DIR wxT("/usr/openwin/lib/app-defaults")
|
# define DEFAULT_XRESOURCE_DIR wxT("/usr/openwin/lib/app-defaults")
|
||||||
// prototype missing in header files on Solaris 2.5
|
|
||||||
extern "C" { int gethostname(char *name, size_t len); }
|
|
||||||
#else
|
#else
|
||||||
# define DEFAULT_XRESOURCE_DIR wxT("/usr/lib/X11/app-defaults")
|
# define DEFAULT_XRESOURCE_DIR wxT("/usr/lib/X11/app-defaults")
|
||||||
#endif
|
#endif
|
||||||
@@ -152,29 +150,15 @@ static void wxXMergeDatabases()
|
|||||||
|
|
||||||
if ((environment = wxGetenv(wxT("XENVIRONMENT"))) == NULL)
|
if ((environment = wxGetenv(wxT("XENVIRONMENT"))) == NULL)
|
||||||
{
|
{
|
||||||
size_t len;
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
char hostbuf[1024];
|
|
||||||
#endif
|
|
||||||
environment = GetIniFile(filename, (const wxChar *) NULL);
|
environment = GetIniFile(filename, (const wxChar *) NULL);
|
||||||
len = wxStrlen(environment);
|
size_t len = wxStrlen(environment);
|
||||||
#if !defined(SVR4) || defined(__sgi)
|
|
||||||
#if wxUSE_UNICODE
|
char hostbuf[1024];
|
||||||
(void)gethostname(hostbuf, 1024 - len);
|
(void)wxGetHostName(hostbuf, WXSIZEOF(hostbuf) - len);
|
||||||
#else
|
|
||||||
(void)gethostname(environment + len, 1024 - len);
|
wxStrcat(environment, wxConvCurrent->cMB2WX(hostbuf));
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
(void)sysinfo(SI_HOSTNAME, hostbuf, 1024 - len);
|
|
||||||
#else
|
|
||||||
(void)sysinfo(SI_HOSTNAME, environment + len, 1024 - len);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
wxStrcat(environment, wxConvCurrent->cMB2WX(hostbuf));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((homeDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(environment))))
|
if ((homeDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(environment))))
|
||||||
XrmMergeDatabases(homeDB, &wxResourceDatabase);
|
XrmMergeDatabases(homeDB, &wxResourceDatabase);
|
||||||
}
|
}
|
||||||
|
@@ -41,8 +41,6 @@
|
|||||||
// so we should use some other strategy!
|
// so we should use some other strategy!
|
||||||
#ifdef __SUN__
|
#ifdef __SUN__
|
||||||
# define DEFAULT_XRESOURCE_DIR wxT("/usr/openwin/lib/app-defaults")
|
# define DEFAULT_XRESOURCE_DIR wxT("/usr/openwin/lib/app-defaults")
|
||||||
// prototype missing in header files on Solaris 2.5
|
|
||||||
extern "C" { int gethostname(char *name, size_t len); }
|
|
||||||
#else
|
#else
|
||||||
# define DEFAULT_XRESOURCE_DIR wxT("/usr/lib/X11/app-defaults")
|
# define DEFAULT_XRESOURCE_DIR wxT("/usr/lib/X11/app-defaults")
|
||||||
#endif
|
#endif
|
||||||
@@ -152,29 +150,15 @@ static void wxXMergeDatabases()
|
|||||||
|
|
||||||
if ((environment = wxGetenv(wxT("XENVIRONMENT"))) == NULL)
|
if ((environment = wxGetenv(wxT("XENVIRONMENT"))) == NULL)
|
||||||
{
|
{
|
||||||
size_t len;
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
char hostbuf[1024];
|
|
||||||
#endif
|
|
||||||
environment = GetIniFile(filename, (const wxChar *) NULL);
|
environment = GetIniFile(filename, (const wxChar *) NULL);
|
||||||
len = wxStrlen(environment);
|
size_t len = wxStrlen(environment);
|
||||||
#if !defined(SVR4) || defined(__sgi)
|
|
||||||
#if wxUSE_UNICODE
|
char hostbuf[1024];
|
||||||
(void)gethostname(hostbuf, 1024 - len);
|
(void)wxGetHostName(hostbuf, WXSIZEOF(hostbuf) - len);
|
||||||
#else
|
|
||||||
(void)gethostname(environment + len, 1024 - len);
|
wxStrcat(environment, wxConvCurrent->cMB2WX(hostbuf));
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
(void)sysinfo(SI_HOSTNAME, hostbuf, 1024 - len);
|
|
||||||
#else
|
|
||||||
(void)sysinfo(SI_HOSTNAME, environment + len, 1024 - len);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
wxStrcat(environment, wxConvCurrent->cMB2WX(hostbuf));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((homeDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(environment))))
|
if ((homeDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(environment))))
|
||||||
XrmMergeDatabases(homeDB, &wxResourceDatabase);
|
XrmMergeDatabases(homeDB, &wxResourceDatabase);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user