Cannot build Ghostscript on Windows with Visual Studio .NET 2003 (and with Visual Studio 6, I think), because at link time the symbol "_wmemset" is not defined. Cause: please see comment #1 below.
Created attachment 7680 [details] Suggested patch. Bug #692349: utf8-Ghostscript - 'wmemset()' not found when compiling with VS2003 or VS6. 'wmemset()' is documented for both Visual Studio 6.0 and .NET 2003, but a bug in the shipped "wctype.h" makes it available only for C++ programs. As this is an inline function, it's not found in the libs. This function was used only in 2 places. In one, it is replaced by a loop. For the other, we now allocate an extra blank line so the 'memmove()' that scrolls the buffer will also clear the last line by copying the extra blanks; the second 'wmemset()' isn't necessary anymore.
Current revision compiles on VS2003, 32-bit just fine. I've tested debug and release builds.
> Current revision compiles on VS2003, 32-bit just fine. If I build using VS2003 WITH the utf8 stuff in, I get dwtext.obj : error LNK2019: unresolved external symbol _wmemset referenced in function _text_create My local 'master' was behind the server's 'master' (GIT GUI didn't do what I *thought* it did), so I did not have the change that removes the utf8 code when building on VS2003 and VS6. But sacrifice a feature for a small and not so useful CRT call? I'm changing this to an enhancement. And if you agree with my change, also please remove the /DWINDOWS_NO_UNICODE from msvc.mak (the "CFLAGS=" line #867 at this time).
Assign to the author of the relevant changes.
Created attachment 7727 [details] Implement wmemset() Many thanks to SaGS for analyzing the problem. I think, that my patch, which implements wmemset(), is easier to understand. BTW, current version defines /DWINDOWS_NO_UNICODE by default.
Fixed in: commit 951dee021a45d501e159a3b08624979604e906f5 Author: Robin Watts <Robin.Watts@artifex.com> Date: Sat Jul 30 17:48:14 2011 +0100 Fix bug 692349: UNICODE build of gs not available with VS2003 or VS6. Apply a slightly tweaked version of alexchers patch to define wmemset when it's not provided by the headers. No cluster differences expected. Thanks guys.