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
This commit is contained in:
Robert Roebling
2002-08-05 18:04:08 +00:00
parent d7a7bd6d27
commit 401eb3dec2
28 changed files with 121 additions and 48 deletions

View File

@@ -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__)

View File

@@ -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 )
{

View File

@@ -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 )
{

View File

@@ -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();

View File

@@ -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());

View File

@@ -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);
}
}
}

View File

@@ -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;
}