help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] RE: MinGW patch


From: Akeroyd, FA \(Freddie\)
Subject: [Help-smalltalk] RE: MinGW patch
Date: Tue, 3 Jul 2007 14:45:35 +0100

> Close enough: files are closed during the #aboutToQuit.  I'll think
more 
> about it (it does not seem to bad to just add a 
> AC_CHECK_FUNCS(_flushall) and add the _flushall where you suggest, or 
> maybe we could add a more standard "fflush(stdout);fflush(stderr);"?).

"fflush(stdout);fflush(stderr);" or "fflush(NULL);" both do the job. 
Looking more at the code I see "aboutToQuit" closes the low level fd, so
any unflushed data written via the stdout FILE pointer by e.g. printf
gets lost. All Smalltalk file I/O looks like it goes via an fd, so I
think stdout (maybe stderr too, but I believe that is usually
unbuffered) is probably the only one that needs catching.

> I reorganized your win_utils.[ch] around the preexisting socketx.h 
> header.  Could you test this patch (which does not include your
kernel/* 
> changes)?

The patch works fine with a couple of minor tweaks:

* socketx.c needs to include config.h as socketx.h uses
HAVE_INET_SOCKETS

* There is an issue with build-aux/inet.m4  The MinGW libwsock32.a only
exports __stdcall decorated names (address@hidden etc) and so the test there
does not detect it. I enclose a possible patch for this.

* I stared getting 
      alloc.h:76: warning: declaration does not declare anything
and alloc.c failed to compile. I traced the problem to a definition in
rpcndr.h which is included by winsock.h and does

#define small char

Adding 

#undef small

To alloc.h fixed this

Regards,

Freddie

-----Original Message-----
From: Paolo Bonzini [mailto:address@hidden 
Sent: 02 July 2007 19:56
To: Akeroyd, FA (Freddie); GNU Smalltalk
Subject: Re: MinGW patch


> I haven't traced the quit.st problem as yet. If I comment out the call
> to send the "aboutToQuit" message in VMpr_ObjectMemory_quit() it works
> OK; when the line is present the "Execution begins..." output is lost
> and so the test fails. I've stepped through the lines in gdb but no
> crash/errors are reported and it gets to exit(arg1) OK. Adding a
> _flushall() call before sending "aboutToQuit" makes the output appear
on
> the screen, but adding one after the call does not, so it would appear
> that the output is removed while "aboutToQuit" is being processed.


I reorganized your win_utils.[ch] around the preexisting socketx.h 
header.  Could you test this patch (which does not include your kernel/*

changes)?

Paolo

Attachment: mingw-inet.patch
Description: mingw-inet.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]