From: Robert Roebling Date: Mon, 5 Aug 2002 18:04:08 +0000 (+0000) Subject: Lots of Unix/Unicode compile fixes, some of which X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/401eb3dec29c09b9afcc843842cba48b33a5089b?ds=inline Lots of Unix/Unicode compile fixes, some of which are just #ifdef 0 such as the wxExecute calls in gdcps.cpp. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/colour.h b/include/wx/gtk/colour.h index e399d074b2..f07bce2d9d 100644 --- a/include/wx/gtk/colour.h +++ b/include/wx/gtk/colour.h @@ -48,6 +48,10 @@ public: // Implicit conversion from the colour name wxColour( const wxString &colourName ) { InitFromName(colourName); } wxColour( const char *colourName ) { InitFromName(colourName); } +#if wxUSE_UNICODE + wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); } +#endif + wxColour( const wxColour& col ) : wxGDIObject() diff --git a/include/wx/gtk/combobox.h b/include/wx/gtk/combobox.h index e7be38f91b..b0e0bea5e4 100644 --- a/include/wx/gtk/combobox.h +++ b/include/wx/gtk/combobox.h @@ -33,7 +33,7 @@ class wxComboBox; // global data //----------------------------------------------------------------------------- -extern const char* wxComboBoxNameStr; +extern const wxChar* wxComboBoxNameStr; extern const wxChar* wxEmptyString; //----------------------------------------------------------------------------- diff --git a/include/wx/gtk/gauge.h b/include/wx/gtk/gauge.h index ee018c01a1..4d3df31ff4 100644 --- a/include/wx/gtk/gauge.h +++ b/include/wx/gtk/gauge.h @@ -33,7 +33,7 @@ class wxGauge; // global data //----------------------------------------------------------------------------- -extern const char* wxGaugeNameStr; +extern const wxChar* wxGaugeNameStr; //----------------------------------------------------------------------------- // wxGaugeBox diff --git a/include/wx/gtk/notebook.h b/include/wx/gtk/notebook.h index b211142699..d65e1a1479 100644 --- a/include/wx/gtk/notebook.h +++ b/include/wx/gtk/notebook.h @@ -39,14 +39,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = "notebook"); + const wxString& name = wxT("notebook")); // Create() function bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = "notebook"); + const wxString& name = wxT("notebook")); // dtor virtual ~wxNotebook(); diff --git a/include/wx/gtk/spinctrl.h b/include/wx/gtk/spinctrl.h index 14065fb96a..f3af16601a 100644 --- a/include/wx/gtk/spinctrl.h +++ b/include/wx/gtk/spinctrl.h @@ -59,8 +59,6 @@ public: virtual int GetMax() const; // implementation - // -------------- - void OnChar( wxKeyEvent &event ); bool IsOwnGtkWindow( GdkWindow *window ); diff --git a/include/wx/gtk1/colour.h b/include/wx/gtk1/colour.h index e399d074b2..f07bce2d9d 100644 --- a/include/wx/gtk1/colour.h +++ b/include/wx/gtk1/colour.h @@ -48,6 +48,10 @@ public: // Implicit conversion from the colour name wxColour( const wxString &colourName ) { InitFromName(colourName); } wxColour( const char *colourName ) { InitFromName(colourName); } +#if wxUSE_UNICODE + wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); } +#endif + wxColour( const wxColour& col ) : wxGDIObject() diff --git a/include/wx/gtk1/combobox.h b/include/wx/gtk1/combobox.h index e7be38f91b..b0e0bea5e4 100644 --- a/include/wx/gtk1/combobox.h +++ b/include/wx/gtk1/combobox.h @@ -33,7 +33,7 @@ class wxComboBox; // global data //----------------------------------------------------------------------------- -extern const char* wxComboBoxNameStr; +extern const wxChar* wxComboBoxNameStr; extern const wxChar* wxEmptyString; //----------------------------------------------------------------------------- diff --git a/include/wx/gtk1/gauge.h b/include/wx/gtk1/gauge.h index ee018c01a1..4d3df31ff4 100644 --- a/include/wx/gtk1/gauge.h +++ b/include/wx/gtk1/gauge.h @@ -33,7 +33,7 @@ class wxGauge; // global data //----------------------------------------------------------------------------- -extern const char* wxGaugeNameStr; +extern const wxChar* wxGaugeNameStr; //----------------------------------------------------------------------------- // wxGaugeBox diff --git a/include/wx/gtk1/notebook.h b/include/wx/gtk1/notebook.h index b211142699..d65e1a1479 100644 --- a/include/wx/gtk1/notebook.h +++ b/include/wx/gtk1/notebook.h @@ -39,14 +39,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = "notebook"); + const wxString& name = wxT("notebook")); // Create() function bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = "notebook"); + const wxString& name = wxT("notebook")); // dtor virtual ~wxNotebook(); diff --git a/include/wx/gtk1/spinctrl.h b/include/wx/gtk1/spinctrl.h index 14065fb96a..f3af16601a 100644 --- a/include/wx/gtk1/spinctrl.h +++ b/include/wx/gtk1/spinctrl.h @@ -59,8 +59,6 @@ public: virtual int GetMax() const; // implementation - // -------------- - void OnChar( wxKeyEvent &event ); bool IsOwnGtkWindow( GdkWindow *window ); diff --git a/include/wx/motif/bmpbuttn.h b/include/wx/motif/bmpbuttn.h index 68a92fb886..b1fa37bd96 100644 --- a/include/wx/motif/bmpbuttn.h +++ b/include/wx/motif/bmpbuttn.h @@ -70,6 +70,7 @@ public: // Implementation void DoSetBitmap(); virtual void ChangeBackgroundColour(); + virtual wxSize DoGetBestSize() const; protected: wxBitmap m_buttonBitmapFocus; diff --git a/src/common/dynload.cpp b/src/common/dynload.cpp index daf499db98..bc83817efc 100644 --- a/src/common/dynload.cpp +++ b/src/common/dynload.cpp @@ -36,6 +36,7 @@ #endif #include "wx/filename.h" // for SplitPath() +#include "wx/strconv.h" #include "wx/dynload.h" #include "wx/module.h" @@ -167,7 +168,7 @@ bool wxDynamicLibrary::Load(wxString libname, int flags) #endif } - m_handle = dlopen(libname.c_str(), rtldFlags); + m_handle = dlopen(libname.fn_str(), rtldFlags); #endif // __VMS || __DARWIN__ ? #elif defined(HAVE_SHL_LOAD) @@ -183,7 +184,7 @@ bool wxDynamicLibrary::Load(wxString libname, int flags) { shlFlags |= BIND_IMMEDIATE; } - m_handle = shl_load(libname.c_str(), BIND_DEFERRED, 0); + m_handle = shl_load(libname.fn_str(), BIND_DEFERRED, 0); #elif defined(__WINDOWS__) m_handle = ::LoadLibrary(libname.c_str()); @@ -195,7 +196,14 @@ bool wxDynamicLibrary::Load(wxString libname, int flags) { wxString msg(_("Failed to load shared library '%s'")); #if defined(HAVE_DLERROR) && !defined(__EMX__) - const wxChar *err = dlerror(); + +#if defined(__WXGTK__) && wxUSE_UNICODE + wxWCharBuffer buffer = wxConvLocal.cMB2WC( dlerror() ); + const wxChar *err = buffer; +#else + const wxChar *err = dlerror(); +#endif + if( err ) wxLogError( msg, err ); #else @@ -252,10 +260,10 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const DosQueryProcAddr( m_handle, 1L, name.c_str(), (PFN*)symbol ); #elif defined(HAVE_DLOPEN) || defined(__DARWIN__) - symbol = dlsym( m_handle, name.c_str() ); + symbol = dlsym( m_handle, name.fn_str() ); #elif defined(HAVE_SHL_LOAD) - if( shl_findsym( &m_handle, name.c_str(), TYPE_UNDEFINED, &symbol ) != 0 ) + if( shl_findsym( &m_handle, name.fn_str(), TYPE_UNDEFINED, &symbol ) != 0 ) symbol = 0; #elif defined(__WINDOWS__) @@ -269,7 +277,14 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const { wxString msg(_("wxDynamicLibrary failed to GetSymbol '%s'")); #if defined(HAVE_DLERROR) && !defined(__EMX__) + +#if defined(__WXGTK__) && wxUSE_UNICODE + wxWCharBuffer buffer = wxConvLocal.cMB2WC( dlerror() ); + const wxChar *err = buffer; +#else const wxChar *err = dlerror(); +#endif + if( err ) { failed = TRUE; diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index bcd3a92295..8fd501fe1d 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1040,9 +1040,9 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil FILE *fp2 = (FILE *) NULL; FILE *fp3 = (FILE *) NULL; // Open the inputs and outputs - if ((fp1 = wxFopen (OS_FILENAME( file1 ), wxT("rb"))) == NULL || - (fp2 = wxFopen (OS_FILENAME( file2 ), wxT("rb"))) == NULL || - (fp3 = wxFopen (OS_FILENAME( outfile ), wxT("wb"))) == NULL) + if ((fp1 = wxFopen ( file1, wxT("rb"))) == NULL || + (fp2 = wxFopen ( file2, wxT("rb"))) == NULL || + (fp3 = wxFopen ( outfile, wxT("wb"))) == NULL) { if (fp1) fclose (fp1); diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 05a84579cf..cac48112e5 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -640,7 +640,7 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp) // can use the cast here because the length doesn't change and the string // is not shared - int fdTemp = mkstemp((char *)path.mb_str()); + int fdTemp = mkstemp((char*)(const char *)path.mb_str()); if ( fdTemp == -1 ) { // this might be not necessary as mkstemp() on most systems should have @@ -1601,7 +1601,7 @@ bool wxFileName::SetTimes(const wxDateTime *dtAccess, utimbuf utm; utm.actime = dtAccess ? dtAccess->GetTicks() : dtMod->GetTicks(); utm.modtime = dtMod ? dtMod->GetTicks() : dtAccess->GetTicks(); - if ( utime(GetFullPath(), &utm) == 0 ) + if ( utime(GetFullPath().fn_str(), &utm) == 0 ) { return TRUE; } @@ -1639,7 +1639,7 @@ bool wxFileName::Touch() { #if defined(__UNIX_LIKE__) // under Unix touching file is simple: just pass NULL to utime() - if ( utime(GetFullPath(), NULL) == 0 ) + if ( utime(GetFullPath().fn_str(), NULL) == 0 ) { return TRUE; } @@ -1660,7 +1660,7 @@ bool wxFileName::GetTimes(wxDateTime *dtAccess, { #if defined(__UNIX_LIKE__) || defined(__WXMAC__) || (defined(__DOS__) && defined(__WATCOMC__)) wxStructStat stBuf; - if ( wxStat(GetFullPath(), &stBuf) == 0 ) + if ( wxStat(GetFullPath().fn_str(), &stBuf) == 0 ) { if ( dtAccess ) dtAccess->Set(stBuf.st_atime); diff --git a/src/common/msgout.cpp b/src/common/msgout.cpp index 30e50e906b..7addcc6310 100755 --- a/src/common/msgout.cpp +++ b/src/common/msgout.cpp @@ -83,7 +83,7 @@ void wxMessageOutputStderr::Printf(const wxChar* format, ...) out.PrintfV(format, args); va_end(args); - fprintf(stderr, "%s", out.mb_str()); + fprintf(stderr, "%s", (const char*) out.mb_str()); } // ---------------------------------------------------------------------------- @@ -102,7 +102,7 @@ void wxMessageOutputMessageBox::Printf(const wxChar* format, ...) va_end(args); #ifndef __WXMSW__ - out.Replace("\t"," "); + out.Replace(wxT("\t"),wxT(" ")); #endif ::wxMessageBox(out); } diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 822f96397e..634fbd6ee2 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -260,7 +260,7 @@ bool wxTCPServer::Create(const wxString& serverName) { // ensure that the file doesn't exist as otherwise calling socket() would // fail - int rc = remove(serverName); + int rc = remove(serverName.fn_str()); if ( rc < 0 && errno != ENOENT ) { delete addr; @@ -321,7 +321,7 @@ wxTCPServer::~wxTCPServer() #ifdef __UNIX_LIKE__ if ( !m_filename.empty() ) { - if ( remove(m_filename) != 0 ) + if ( remove(m_filename.fn_str()) != 0 ) { wxLogDebug(_T("Stale AF_UNIX file '%s' left."), m_filename.c_str()); } diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index bf4de031f1..de9a68979c 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -328,12 +328,12 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) break; default: - if ( keycode < 256 && keycode >= 0 && isprint(keycode) ) + if ( keycode < 256 && keycode >= 0 && wxIsprint(keycode) ) { // FIXME this is not going to work for non letters... if ( !event.ShiftDown() ) { - keycode = tolower(keycode); + keycode = wxTolower(keycode); } ch = (wxChar)keycode; diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index 264f1d1cf3..e2aaefa573 100644 --- a/src/common/xpmdecod.cpp +++ b/src/common/xpmdecod.cpp @@ -115,9 +115,7 @@ license is as follows: #include "wx/intl.h" #include -#ifdef __VISUALC__ #include -#endif #include "wx/xpmdecod.h" diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 3fe32bf0b2..85774d8d32 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -26,6 +26,8 @@ #if wxUSE_POSTSCRIPT +#include "wx/setup.h" + #include "wx/window.h" #include "wx/dcmemory.h" #include "wx/utils.h" @@ -1577,7 +1579,7 @@ bool wxPostScriptDC::StartDoc( const wxString& message ) m_printData.SetFilename(filename); } - m_pstream = wxFopen( m_printData.GetFilename().fn_str(), wxT("w+") ); + m_pstream = wxFopen( m_printData.GetFilename().c_str(), wxT("w+") ); // FIXME: use fn_str() here under Unicode? if (!m_pstream) { @@ -1748,7 +1750,10 @@ void wxPostScriptDC::EndDoc () argv[0] = WXSTRINGCAST previewCommand; argv[1] = WXSTRINGCAST filename; argv[2] = (wxChar*) NULL; +#if defined(__WXGTK20__) && wxUSE_UNICODE +#else wxExecute( argv, TRUE ); +#endif wxRemoveFile( m_printData.GetFilename() ); } break; @@ -1766,7 +1771,10 @@ void wxPostScriptDC::EndDoc () argv[argc++] = WXSTRINGCAST filename; argv[argc++] = (wxChar *) NULL; +#if defined(__WXGTK20__) && wxUSE_UNICODE +#else wxExecute( argv, TRUE ); +#endif wxRemoveFile( filename ); } break; diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index e8b0e27bab..4dcef850cf 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -29,6 +29,8 @@ #include "wx/log.h" #endif +#include + #include "wx/html/helpdata.h" #include "wx/tokenzr.h" #include "wx/wfstream.h" diff --git a/src/motif/bmpbuttn.cpp b/src/motif/bmpbuttn.cpp index 87bca5cdb1..54d735b856 100644 --- a/src/motif/bmpbuttn.cpp +++ b/src/motif/bmpbuttn.cpp @@ -113,7 +113,19 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit (XtPointer) this); SetCanAddEventHandler(TRUE); - AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); + + wxSize newSize = size; + + if (m_buttonBitmap.Ok()) + { + int border = (style & wxNO_BORDER) ? 4 : 10; + if (newSize.x == -1) + newSize.x = m_buttonBitmap.GetWidth()+border; + if (newSize.y == -1) + newSize.y = m_buttonBitmap.GetHeight()+border; + } + + AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, newSize.x, newSize.y); return TRUE; } @@ -262,3 +274,23 @@ void wxBitmapButton::ChangeBackgroundColour() // Must reset the bitmaps since the colours have changed. DoSetBitmap(); } + +wxSize wxBitmapButton::DoGetBestSize() const +{ + wxSize ret( 30,30 ); + + if (m_buttonBitmap.Ok()) + { + int border = (GetWindowStyle() & wxNO_BORDER) ? 4 : 10; + ret.x = m_buttonBitmap.GetWidth()+border; + ret.y = m_buttonBitmap.GetHeight()+border; + } + + if (!HasFlag(wxBU_EXACTFIT)) + { + if (ret.x < 80) ret.x = 80; + } + + return ret; +} + diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index 3fb0ef3115..8d6a76058e 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -719,10 +719,10 @@ wxDialUpManagerImpl::CheckIfconfig() hasModem = strstr(output,"ipdptp") != (char *)NULL; hasLAN = strstr(output, "hme") != (char *)NULL; #elif defined(__LINUX__) || defined (__FREEBSD__) - hasModem = strstr(output,"ppp") // ppp - || strstr(output,"sl") // slip - || strstr(output,"pl"); // plip - hasLAN = strstr(output, "eth") != NULL; + hasModem = strstr(output.fn_str(),"ppp") // ppp + || strstr(output.fn_str(),"sl") // slip + || strstr(output.fn_str(),"pl"); // plip + hasLAN = strstr(output.fn_str(), "eth") != NULL; #elif defined(__SGI__) // IRIX hasModem = strstr(output, "ppp") != NULL; // PPP #elif defined(__HPUX__) diff --git a/src/unix/dir.cpp b/src/unix/dir.cpp index 95f2e78f19..7be4969c30 100644 --- a/src/unix/dir.cpp +++ b/src/unix/dir.cpp @@ -303,7 +303,7 @@ bool wxDir::HasSubDirs(const wxString& spec) // caller will learn it soon enough when it calls GetFirst(wxDIR) // anyhow wxStructStat stBuf; - if ( wxStat(M_DIR->GetName(), &stBuf) == 0 ) + if ( wxStat(M_DIR->GetName().fn_str(), &stBuf) == 0 ) { switch ( stBuf.st_nlink ) { diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index fdeb46a105..653aa52679 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -107,7 +107,12 @@ static bool ProcessFamiliesFromFontList(wxFontEnumerator *This, { char *font = fonts[n]; #if wxUSE_REGEX +#if wxUSE_UNICODE + wxString sfont( wxConvLocal.cMB2WC( font ) ); + if ( !re.Matches(sfont) ) +#else if ( !re.Matches(font) ) +#endif #else // !wxUSE_REGEX if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) ) #endif // wxUSE_REGEX/!wxUSE_REGEX @@ -120,7 +125,11 @@ static bool ProcessFamiliesFromFontList(wxFontEnumerator *This, char *family = dash + 1; dash = strchr(family, '-'); *dash = '\0'; // !NULL because Matches() above succeeded +#if wxUSE_UNICODE + wxString fam( wxConvLocal.cMB2WC( family ) ); +#else wxString fam(family); +#endif if ( families.Index(fam) == wxNOT_FOUND ) { diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 9501ea5ee7..169ae54a1d 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -455,7 +455,7 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize, (void) tokenizer.NextToken(); - newFontName += wxString::Format("%d-", pointSize); + newFontName += wxString::Format(wxT("%d-"), pointSize); while(tokenizer.HasMoreTokens()) newFontName += tokenizer.GetNextToken(); diff --git a/src/unix/snglinst.cpp b/src/unix/snglinst.cpp index 9cc4155e80..8ccedd75df 100644 --- a/src/unix/snglinst.cpp +++ b/src/unix/snglinst.cpp @@ -151,7 +151,7 @@ private: LockResult wxSingleInstanceCheckerImpl::CreateLockFile() { // try to open the file - m_fdLock = open(m_nameLock, + m_fdLock = open(m_nameLock.fn_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); @@ -192,7 +192,7 @@ LockResult wxSingleInstanceCheckerImpl::CreateLockFile() wxLogSysError(_("Failed to lock the lock file '%s'"), m_nameLock.c_str()); - unlink(m_nameLock); + unlink(m_nameLock.fn_str()); return LOCK_ERROR; } @@ -257,7 +257,7 @@ bool wxSingleInstanceCheckerImpl::Create(const wxString& name) { if ( kill(m_pidLocker, 0) != 0 ) { - if ( unlink(name) != 0 ) + if ( unlink(name.fn_str()) != 0 ) { wxLogError(_("Failed to remove stale lock file '%s'."), name.c_str()); @@ -291,7 +291,7 @@ void wxSingleInstanceCheckerImpl::Unlock() { if ( m_fdLock != -1 ) { - if ( unlink(m_nameLock) != 0 ) + if ( unlink(m_nameLock.fn_str()) != 0 ) { wxLogSysError(_("Failed to remove lock file '%s'"), m_nameLock.c_str()); diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index d87748e03f..47e9a41e62 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -210,7 +210,7 @@ wxMutexInternal::wxMutexInternal(wxMutexType mutexType) m_isOk = err == 0; if ( !m_isOk ) { - wxLogApiError("pthread_mutex_init()", err); + wxLogApiError( wxT("pthread_mutex_init()"), err); } } @@ -221,7 +221,7 @@ wxMutexInternal::~wxMutexInternal() int err = pthread_mutex_destroy(&m_mutex); if ( err != 0 ) { - wxLogApiError("pthread_mutex_destroy()", err); + wxLogApiError( wxT("pthread_mutex_destroy()"), err); } } } diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 97f764b829..70d467e744 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -253,7 +253,11 @@ long wxExecute( const wxString& command, int flags, wxProcess *process ) argv[argc] = NULL; // do execute the command +#if wxUSE_UNICODE + long lRc = -1; +#else long lRc = wxExecute(argv, flags, process); +#endif // clean up argc = 0; @@ -1105,9 +1109,9 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) #if defined(HAVE_STATFS) || defined(HAVE_STATVFS) // the case to "char *" is needed for AIX 4.3 wxStatFs fs; - if ( statfs((char *)path.fn_str(), &fs) != 0 ) + if ( statfs((char *)(const char*)path.fn_str(), &fs) != 0 ) { - wxLogSysError("Failed to get file system statistics"); + wxLogSysError( wxT("Failed to get file system statistics") ); return FALSE; }