]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
Use font encoding
[wxWidgets.git] / src / unix / utilsunx.cpp
index 67a97b734a772385b86ca09736ea3b15a391d27e..41ee69bfc76732ce711af087a9c8af8173ba70e2 100644 (file)
      defined(__osf__) || defined(__EMX__))
     extern "C"
     {
-        #ifdef __SUN__
+        #ifdef __EMX__
+            /* I copied this from the XFree86 diffs. AV. */
+            #define INCL_DOSPROCESS
+            #include <os2.h>
+            inline void usleep(unsigned long delay)
+            {
+                DosSleep(delay ? (delay/1000l) : 1l);
+            }
+        #else // Unix
             int usleep(unsigned int usec);
-        #else // !Sun
-            #ifdef __EMX__
-                /* I copied this from the XFree86 diffs. AV. */
-                #define INCL_DOSPROCESS
-                #include <os2.h>
-                inline void usleep(unsigned long delay)
-                {
-                    DosSleep(delay ? (delay/1000l) : 1l);
-                }
-            #else // !Sun && !EMX
-                void usleep(unsigned long usec);
-            #endif
-        #endif // Sun/EMX/Something else
+        #endif // __EMX__/Unix
     };
 
     #define HAVE_USLEEP 1
@@ -794,7 +790,13 @@ static bool wxGetHostNameInternal(wxChar *buf, int sz)
         buf[sz] = wxT('\0');
     }
 #elif defined(HAVE_GETHOSTNAME)
-    bool ok = gethostname(buf, sz) != -1;
+    char cbuf[sz];
+    bool ok = gethostname(cbuf, sz) != -1;
+    if ( ok )
+    {
+        wxStrncpy(buf, wxConvertMB2WX(cbuf), sz - 1);
+        buf[sz] = wxT('\0');
+    }
 #else // no uname, no gethostname
     wxFAIL_MSG(wxT("don't know host name for this machine"));