Problems building experimental Unicode version of Hugs on Windows

Graham Klyne gk at ninebynine.org
Fri Jan 9 17:52:47 EST 2004


This message notes some edits I'm making to try and build the Dec2003 Hugs 
source kit with Unicode under MS-Windows (because I want to try and use 
HXML toolbox under Hugs).  It also describes a problem I'm having with the 
experimental Unicode support under Windows.

(I'm also thinking these notes might be helpful to anyone else who wants to 
build Hugs on Windows without using the Unix tools environment.)

Using Microsoft Visual Studio, version 6, and supplied project files:

(1) edit src/msc/options.h to include #define UNICODE_CHARS_1

(2) Change #if STDCALL_SUPPORTED to #ifdef STDCALL_SUPPORTED in:
     connect.h
     input.c
     static.c

(3) Add the following files to the Visual Studio project:
     char.c
     edit.c
     errors.c
     evaluator.c
     goal.c
     machdep.c
     module.c
     observe.c
     opts.c
     script.c
     strutil.c

(4) In version.c, changed the definition of VERSION_STRING to 
"Hugs-Unicode-20031206, so that this instantiation of Hugs will use a 
different registry key from the standard version for saving its options.

Copied the resulting executable into the Hugs installation directory as 
hugs-unicode-20031206.exe (this being the date string in the source kit I 
was using, obtained from):
   http://www.golubovsky.org/software/hugs-patch/test-hugs98-Dec2003.tar.gz
per:
   http://haskell.org/pipermail/hugs-users/2003-December/000508.html
   http://www.golubovsky.org/software/hugs-patch/hugs_unicode_test.html

...

At this point, I run into a problem that appears to be (obscurely) related 
to the source changes that relate to Unicode support...

If I start the modified program in the normal way, it appears to start OK.
But if I change *any* option (e.g. :set -q), then stop and restart the 
program, I get:
    ERROR, a closing quote, '"', was expected
    FATAL ERROR, Unable to load Prelude
and then the program crashes with an access violation, in module char.c, 
function freeConsCharTable, line 539:
[[
static void local freeConsCharTable() {
     int i, j;

     for (j=1; j<NUM_LEVEL2; j++)
 >>> this line:
 >>>     if (consCharTable[0][j]!=NULL)
             free(consCharTable[0][j]);
     for (i=1; i<NUM_LEVEL1; i++)
         if (consCharTable[i]!=NULL) {
             for (j=0; j<NUM_LEVEL2; j++)
                 if (consCharTable[i][j]!=NULL)
                     free(consCharTable[i][j]);
             free(consCharTable[i]);
         }
]]

The debugger shows that "consCharTable[0]" is null (0).  I note that this 
is new code which is part of the experimental Unicode support.

If I delete the registry key created for the saved parameters, and restart 
Hugs, basic expressions seem to work fine.  (e.g. simple string operations 
like concatenation were performed OK).

...

The build procedure I've outlined above is essentially the same as one I 
used to create a version of Hugs with enlarged code storage space, which 
has been working fine for me.

I'll leave it there, for now.

#g


------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact



More information about the Haskell mailing list