[ENH][PLUGIN] LargeIntegers plugin/module with bit logic
Andreas.Raab at disney.com
Wed Mar 15 02:33:17 UTC 2000
> > Using
> > unresolved symbols in a library is not allowed on Windows
> >(and on Macs as well AFAIK)
> In Linux it works:
> void error(char *s);
> , declared in sq.h and defined in interp.c will be called.
I know but it's a dangerous thing to play with. [Random ObBesides: I always
thought this kind of implicit linkage between DSOs close to being a design
flaw. If you have several DSOs exporting 'foo()' you'll never know for sure
which one is called from where].
Also, 'sq.h' should in general not be included in any plugin - since it can
be compiled standalone you absolutely must go through the interpreter proxy
and not rely on some (possibly version specific) definitions of the current
VM. Otherwise you risk breaking the plugin with either a newer or an older
> Questions to Andreas:
> Does stderr output work under Windows (e.g. by 'LargeIntegersPlugin
> debug: true')?
Nope. Since Squeak is compiled as a GUI application it doesn't get an
associated console to write stuff into. And, since implicit linkage is not
supported, the special handling from within the VM (basically overriding
printf() and fprintf() to redirect any such messages into a GUI window)
doesn't take effect here. I could theoretically make this work by exporting
printf() and fprintf() from the VM and then link the DLLs against the VM.
But somebody has to give me A Very Good Reason to do so (it's a lot of work
and I don't see any real use for it since for debugging you can always
compile the plugin directly into the VM and then the VM overrides will take
On the Mac it's actually a little different - you can see stuff written to
stdout/stderr from a code fragment in a window popping up (it's quite
annoying btw) but once you've switched back to Squeak it seems impossible to
read what's been written into this window before (dunno why). So it doesn't
make a lot of sense except for some final error message which results in
aborting Squeak anyways (and that's what #error: does).
More information about the Squeak-dev