[squeak-dev] Smalltalk platformName in Win64 image >> Win32

Eliot Miranda eliot.miranda at gmail.com
Tue Jun 26 16:26:23 UTC 2018

Hi John-Reed,

On Tue, Jun 26, 2018 at 8:33 AM, John-Reed Maffeo <jrmaffeo at gmail.com>

> The value returned from "Smalltalk platformName" on  the 64 bit 5.2A image
> is Win32. Does this matter?

Alas it does :-(.  There is much code in the system that explicitly tests
for 'Win32', for example in various implementations
of clipboardInterpreterClass.  If the 64-bit VM were to report, more
accurately, Win64, then lots of code would break.

Maybe at a major release we could fix this, but when this issue surfaced
(May 2017, see commit ca7e8db32835f5d2489ebddc7e14a51c9bbd4697), I chose to
- change getSystemAttribute: 1005 (the Windowing system name) to answer
Windows instead of Win32
- keep getSystemAttribute: 1001 (the primary OS name) answering Win32

I guess a prudent way to deal with this for the moment is to implement
SmalltalkImage>>is32BitWindows &  SmalltalkImage>>is64BitWindows (along
with some other useful ones) to insulate clients from the details of the
getSystemAttribute: interface, and then later we can try and remedy the

In fact, if there are any volunteers motivated enough it would be really
nice to see code like

| platformName osVersion |
platformName := Smalltalk platformName.
osVersion := Smalltalk osVersion.
(platformName = 'Win32' and: [osVersion = 'CE'])
ifTrue: [^NoConversionClipboardInterpreter].
platformName = 'Win32' ifTrue: [^UTF8ClipboardInterpreter].
platformName = 'Mac OS' ifTrue: [^MacShiftJISClipboardInterpreter].
^platformName = 'unix'
[(ShiftJISTextConverter encodingNames includes: X11Encoding getEncoding)
ifTrue: [MacShiftJISClipboardInterpreter]
ifFalse: [UnixJPClipboardInterpreter]]
ifFalse: [ NoConversionClipboardInterpreter ]

rewritten to more closely resemble

Smalltalk os isWindows ifTrue:
[^Smalltalk os isWindowsCE
ifTrue: [NoConversionClipboardInterpreter]
ifFalse: [UTF8ClipboardInterpreter]].
Smalltalk os isMacOSX ifTrue:
Smalltalk os isUnix ifTrue:
[^(ShiftJISTextConverter encodingNames includes: X11Encoding getEncoding)
ifTrue: [MacShiftJISClipboardInterpreter]
ifFalse: [UnixJPClipboardInterpreter]].


(Smalltalk os isWindows
and: [Smalltalk os isWindowsCE not]) ifTrue:
[^ UTF8ClipboardInterpreter].
Smalltalk os isMacOSX ifTrue:
Smalltalk os isUnix ifTrue:
[(Smalltalk os isMacOSX
or: [ShiftJISTextConverter encodingNames includes: X11Encoding
getEncoding]) ifTrue:

> Windows\Squeak5.2alpha-18110-64bit\Squeak5.2alpha-18110-64bit.1.image
> Squeak5.2alpha
> latest update: #18110
> Current Change Set: BBCRR-RestartAt5.2alpha
> Image format 68021 (64 bit)
> - jrm

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180626/89dd6d03/attachment.html>

More information about the Squeak-dev mailing list