]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
made default background colour BTNFACE (so that panels don't have to erase their...
[wxWidgets.git] / src / unix / utilsunx.cpp
index 6169570d98c6a47701e4dc55a329c4bf56373e57..4386411aa4bbdce254b18782f80725e11dc3d638 100644 (file)
@@ -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__