changeset 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
files makefile.emx makefile.vac makefile.wpm os2/dw.c
diffstat 4 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/makefile.emx	Mon Apr 30 16:49:38 2012 +0000
+++ b/makefile.emx	Mon Apr 30 17:13:16 2012 +0000
@@ -16,7 +16,7 @@
 DEFS =
 LIBS =
 
-CFLAGS = -O -g -Zomf -Zmt -D__OS2__ -D__ST_MT_ERRNO__ -DVER_REV=$(VERREV) -I. -Wall -o $(@)
+CFLAGS = -O -g -Zomf -Zmt -D__OS2__ -D__ST_MT_ERRNO__ -DUNICODE -DVER_REV=$(VERREV) -I. -Wall -o $(@)
 LDFLAGS = -Zdll -static-libgcc
 RCFLAGS = -r
 
--- a/makefile.vac	Mon Apr 30 16:49:38 2012 +0000
+++ b/makefile.vac	Mon Apr 30 17:13:16 2012 +0000
@@ -10,7 +10,7 @@
     .\dwtest.exe
 
 .c.obj:
-  icc.exe  /DOS2 /DTCPV40HDRS /DBUILD_DLL /DVER_REV=$(VERREV) /I. /Tm+ /Tdc /Ss /V"Dynamic Windows Compatibility" /Ti /Gm /Gd- /G5 /Ge- /C /W3 %s
+  icc.exe  /DOS2 /DTCPV40HDRS /DBUILD_DLL /DUNICODE /DVER_REV=$(VERREV) /I. /Tm+ /Tdc /Ss /V"Dynamic Windows Compatibility" /Ti /Gm /Gd- /G5 /Ge- /C /W3 %s
 
 .\dw.dll: \
     .\os2\dw.obj
--- a/makefile.wpm	Mon Apr 30 16:49:38 2012 +0000
+++ b/makefile.wpm	Mon Apr 30 17:13:16 2012 +0000
@@ -4,7 +4,7 @@
 #
 #===================================================================
 OS22_H = $(%WATCOM)\h\os2
-CFLAGS  = -i=os2 -i=$(OS22_H) -bm -bt=OS2 -zq -d2 -bd -sg
+CFLAGS  = -i=os2 -i=$(OS22_H) -DUNICODE -bm -bt=OS2 -zq -d2 -bd -sg
 TKPATH=C:\Toolkit
 TLKTLIB = $(TKPATH)\LIB
 
--- 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]);