# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1335805996 0 # Node ID 3fb7002e4de67edbbb7f8c54d581060e03d2baab # Parent 72ac6eb33d7676f043e6824abdd7b6ca3769c90f 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. diff -r 72ac6eb33d76 -r 3fb7002e4de6 makefile.emx --- 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 diff -r 72ac6eb33d76 -r 3fb7002e4de6 makefile.vac --- 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 diff -r 72ac6eb33d76 -r 3fb7002e4de6 makefile.wpm --- 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 diff -r 72ac6eb33d76 -r 3fb7002e4de6 os2/dw.c --- 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]);