]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/utils.cpp
Visible wxMessageOutputDebug instance.
[wxWidgets.git] / src / os2 / utils.cpp
index dad072f6ab5da4331ba8a7c506815f35f5e33963..d77c05e60de94c53e12546bdf28a79f2f77f2907 100644 (file)
@@ -160,9 +160,9 @@ bool wxShell(
     SData.FgBg     = SSF_FGBG_FORE;
     SData.TraceOpt = SSF_TRACEOPT_NONE;
     SData.PgmTitle = PgmTitle;
-    SData.PgmName  = zShell;
+    SData.PgmName  = (char*)zShell;
 
-    sInputs = "/C " + rCommand;
+    sInputs = _T("/C ") + rCommand;
     SData.PgmInputs     = (BYTE*)sInputs.c_str();
     SData.TermQ         = 0;
     SData.Environment   = 0;
@@ -220,17 +220,23 @@ wxBatteryState wxGetBatteryState()
 wxMemorySize wxGetFreeMemory()
 {
     void*                           pMemptr = NULL;
-    ULONG                           lSize;
+    LONG                            lSize;
     ULONG                           lMemFlags;
     APIRET                          rc;
 
     lMemFlags = PAG_FREE;
-    rc = ::DosQueryMem(pMemptr, &lSize, &lMemFlags);
+    rc = ::DosQueryMem(pMemptr, (PULONG)&lSize, &lMemFlags);
     if (rc != 0)
         lSize = -1L;
     return (wxMemorySize)lSize;
 }
 
+// Get Process ID
+unsigned long wxGetProcessId()
+{
+    return (unsigned long)getpid();
+}
+
 // ----------------------------------------------------------------------------
 // env vars
 // ----------------------------------------------------------------------------
@@ -410,7 +416,7 @@ const wxChar* wxGetHomeDir(
 #  define MAX_PATH  256
 #endif
 
-    const wxChar *szHome = wxGetenv("HOME");
+    const wxChar *szHome = wxGetenv((wxChar*)"HOME");
     if ( szHome == NULL ) {
       // we're homeless, use current directory.
       rStrDir = wxT(".");
@@ -422,14 +428,16 @@ const wxChar* wxGetHomeDir(
 }
 
 // Hack for OS/2
-wxChar* wxGetUserHome (
-  const wxString&                   rUser
-)
+#if wxUSE_UNICODE
+const wxMB2WXbuf wxGetUserHome( const wxString &rUser )
+#else // just for binary compatibility -- there is no 'const' here
+wxChar* wxGetUserHome ( const wxString &rUser )
+#endif
 {
     wxChar*                         zHome;
     wxString                        sUser1(rUser);
 
-    char *wxBuffer = new wxChar[256];
+    wxChar *wxBuffer = new wxChar[256];
 #ifndef __EMX__
     if (!sUser1.empty())
     {
@@ -459,13 +467,19 @@ wxChar* wxGetUserHome (
         {
             wxStrcpy(wxBuffer, zHome);
             wxUnix2DosFilename(wxBuffer);
+#if wxUSE_UNICODE
+           wxWCharBuffer retBuffer (wxBuffer);
+            delete[] wxBuffer;
+            return retBuffer;
+#else      
             wxStrcpy(zHome, wxBuffer);
             delete[] wxBuffer;
             return zHome;
+#endif
         }
     }
     delete[] wxBuffer;
-    return NULL; // No home known!
+    return (wxChar*)wxEmptyString; // No home known!
 }
 
 wxString WXDLLEXPORT wxPMErrorToStr(