X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8bb6b2c057edbcc5b87f00a8af6ac70f6fd69727..3e1924dd5f5744c3e2a8973de9b3e4f372b7fd85:/src/msdos/utilsdos.cpp?ds=sidebyside diff --git a/src/msdos/utilsdos.cpp b/src/msdos/utilsdos.cpp index c876b6939e..ff4647668c 100644 --- a/src/msdos/utilsdos.cpp +++ b/src/msdos/utilsdos.cpp @@ -96,7 +96,7 @@ bool wxGetEnv(const wxString& var, wxString *value) return true; } -bool wxSetEnv(const wxString& variable, const wxChar *value) +static bool wxDoSetEnv(const wxString& variable, const char *value) { wxString s = variable; if ( value ) @@ -112,6 +112,17 @@ bool wxSetEnv(const wxString& variable, const wxChar *value) return putenv(buf) == 0; } +bool wxSetEnv(const wxString& variable, const wxString& value) +{ + return wxDoSetEnv(variable, value.mb_str()); +} + +bool wxUnsetEnv(const wxString& variable) +{ + return wxDoSetEnv(variable, NULL); +} + + //---------------------------------------------------------------------------- // Hostname, username, home directory //---------------------------------------------------------------------------- @@ -200,14 +211,14 @@ const wxChar* wxGetHomeDir(wxString *home) return strDir.c_str(); } -wxChar *wxGetUserHome(const wxString& user) +wxString wxGetUserHome(const wxString& user) { - static wxString home; + wxString home; if (user.empty() || user == wxGetUserId()) - return wx_const_cast(wxChar*, wxGetHomeDir(&home)); - else - return _T(""); + wxGetHomeDir(&home); + + return home; } // returns %UserName%, $USER or just "user" @@ -310,7 +321,7 @@ long wxExecute(const wxString& command, int flags, wxProcess *process) argv[n] = NULL; while (n-- > 0) - argv[n] = wx_const_cast(wxChar*, args[n].c_str()); + argv[n] = wx_const_cast(wxChar*, (const char *)args[n].c_str()); long result = wxExecute(argv, flags, process); @@ -329,7 +340,7 @@ public: : wxFFileInputStream(name, _T("rt")) { } - ~wxTempFileInStream() + virtual ~wxTempFileInStream() { m_file->Close(); wxRemoveFile(m_file->GetName()); @@ -488,3 +499,8 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) return wxOS_DOS; } +bool wxIsPlatform64Bit() +{ + return false; +} +