diff os2/dw.c @ 1689:3fb7002e4de6

Unicode (UTF-8) mode on OS/2 as noted to me by Alex Taylor comes with a performance hit, so you can disable Unicode mode by removing -DUNICODE.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 30 Apr 2012 17:13:16 +0000
parents 72ac6eb33d76
children 0f4bbb78f149
line wrap: on
line diff
--- a/os2/dw.c	Mon Apr 30 16:49:38 2012 +0000
+++ b/os2/dw.c	Mon Apr 30 17:13:16 2012 +0000
@@ -4058,9 +4058,11 @@
    if(newthread)
    {
       dwhab = WinInitialize(0);
-      dwhmq = WinCreateMsgQueue(dwhab, 0);
+	  dwhmq = WinCreateMsgQueue(dwhab, 0);
+#ifdef UNICODE
       /* Set the codepage to 1208 (UTF-8) */
-      WinSetCp(dwhmq, 1208);
+	  WinSetCp(dwhmq, 1208);
+#endif
    }
 
    rc = WinRegisterClass(dwhab, (PSZ)ClassName, _wndproc, CS_SIZEREDRAW | CS_CLIPCHILDREN, 32);
@@ -4621,7 +4623,9 @@
             strcpy(fd.fAttrs.szFacename, currfont);
         }
 	}
-    fd.fAttrs.usCodePage = 1208;
+#ifdef UNICODE
+	fd.fAttrs.usCodePage = 1208;
+#endif
     fd.fAttrs.usRecordLength = sizeof(FATTRS);
 
     /* Fill in the font dialog struct */
@@ -9866,7 +9870,9 @@
 
    fat.usRecordLength  = sizeof(FATTRS);
    fat.lMatch          = fm.lMatch;
+#ifdef UNICODE
    fat.usCodePage      = 1208;
+#endif
    strcpy(fat.szFacename, fm.szFacename);
 
    GpiCreateLogFont(hpsDst, 0, 1L, &fat);
@@ -10947,9 +10953,11 @@
    void (API_FUNC threadfunc)(void *) = NULL;
    void **tmp = (void **)data;
 
+#ifdef UNICODE
    /* Set the codepage to 1208 (UTF-8) */
    WinSetCp(thishmq, 1208);
-   
+#endif
+
    threadfunc = (void (API_FUNC)(void *))tmp[0];
    threadfunc(tmp[1]);