make wxSetEnv compatible with ANSI and Unicode, deprecate passing NULL to it in favour of wxUnsetEnv()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46547 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -238,11 +238,10 @@ bool wxGetEnv(const wxString& var, wxString *value)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSetEnv(const wxString& variable, const wxChar *value)
|
||||
bool wxSetEnv(const wxString& variable, const char *value)
|
||||
{
|
||||
#if defined(HAVE_SETENV)
|
||||
return setenv(variable.mb_str(), value ? wxString(value).mb_str().data()
|
||||
: NULL, 1 /* overwrite */) == 0;
|
||||
return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0;
|
||||
#elif defined(HAVE_PUTENV)
|
||||
wxString s = variable;
|
||||
if ( value )
|
||||
@@ -263,6 +262,16 @@ bool wxSetEnv(const wxString& variable, const wxChar *value)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxSetEnv(const wxString& variable, const wxString& value)
|
||||
{
|
||||
return wxDoSetEnv(variable, value.mb_str());
|
||||
}
|
||||
|
||||
bool wxUnsetEnv(const wxString& variable)
|
||||
{
|
||||
return wxDoSetEnv(variable, NULL);
|
||||
}
|
||||
|
||||
void wxMilliSleep(
|
||||
unsigned long ulMilliseconds
|
||||
)
|
||||
|
Reference in New Issue
Block a user