X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74c719ed9683d49e206b19e8e693d649a1a3b7d1..0ec6ec3266bc89920a46e50a14a448fbe9f9204a:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 2c375b2edb..4386411aa4 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -837,11 +837,20 @@ bool wxGetUserName(wxChar *buf, int sz) wxString wxGetOsDescription() { -#ifndef WXWIN_OS_DESCRIPTION - #error WXWIN_OS_DESCRIPTION should be defined in config.h by configure -#else - return wxString::FromAscii( WXWIN_OS_DESCRIPTION ); -#endif + FILE *f = popen("uname -s -r -m", "r"); + if (f) + { + char buf[256]; + size_t c = fread(buf, 1, sizeof(buf) - 1, f); + pclose(f); + // Trim newline from output. + if (c && buf[c - 1] == '\n') + --c; + buf[c] = '\0'; + return wxString::FromAscii( buf ); + } + wxFAIL_MSG( _T("uname failed") ); + return _T(""); } #endif // !__WXMAC__ @@ -1143,7 +1152,7 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData) } -#if defined(__DARWIN__) && defined(__WXMAC__) +#if defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__)) endProcData->tag = wxAddProcessCallbackForPid(endProcData, execData.pid); #else endProcData->tag = wxAddProcessCallback @@ -1153,7 +1162,7 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData) ); execData.pipeEndProcDetect.Close(); -#endif // defined(__DARWIN__) && defined(__WXMAC__) +#endif // defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__)) if ( execData.flags & wxEXEC_SYNC ) {