[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] ca7e8d: Change platform sources to refer to _WIN32 & _WIN6...

Eliot Miranda eliot.miranda at gmail.com
Wed May 17 23:53:05 UTC 2017


Hi Subbu,

On Tue, May 16, 2017 at 10:01 PM, K K Subbu <kksubbu.ml at gmail.com> wrote:

>
> On Wednesday 17 May 2017 03:50 AM, GitHub wrote:
>
>> Change getSystemAttribute: 1005 (the Windowing system name) to answer
>> 'Windows'
>> insrtead of 'Win32' (we are stuck with answering 'Win32' on 'Win64'
>> unless we
>> want to break /lots/ of image platform-dependent code).  If this breaks
>> things
>> then we'll have tio revert.  But fingers crossed it is not a problem;
>> there are
>> no uses of 1005 assuming other than 'X11' in a base Squeak image.
>>
>
> As a app (i.e. not a driver), vm deals with OS through APIs. Therefore, I
> feel it is better to retain 'Win32' and return 'Win64' for 64-bit. If it
> breaks code in 64-bit image, we can fix it in the image since 64b images
> are relatively new. Changing 'Win32' to Windows may break old images
> already in production :-(.
>

Note that attribute 1001 was not changed and still answers 'Win32'. i only
changed 1005, the windowing system name, to answer 'Windows' instead of
'Win32'.  I did this because the only use of parameter 1005 I could find
was this one:

HandMorph>>compositionWindowManager
CompositionWindowManager ifNotNil: [^CompositionWindowManager].
Smalltalk platformName = 'Win32'
ifTrue: [^CompositionWindowManager := ImmWin32 new].
(Smalltalk platformName = 'unix'
and: [(Smalltalk windowSystemName) = 'X11'])
ifTrue: [^CompositionWindowManager := ImmX11 new].
^CompositionWindowManager := ImmAbstractPlatform new

Notice how it uses Smalltalk platformName = 'Win32', which has not been
changed (platformName = attribute 1001).  The only use of windowSystemName
is (Smalltalk windowSystemName) = 'X11', so my change will not break this
one example.  Please let's wait and see whether there are any other
examples.


BTW, I think the code would read much better as

HandMorph>>compositionWindowManager
CompositionWindowManager ifNotNil: [^CompositionWindowManager].
Smalltalk windowSystemName = 'Windows'
ifTrue: [^CompositionWindowManager := ImmWindows new].
Smalltalk windowSystemName = 'X11'
ifTrue: [^CompositionWindowManager := ImmX11 new].
^CompositionWindowManager := ImmAbstractPlatform new

etc.  And FWIW I would use a case statement that answered the class to use.

_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170517/ac00161f/attachment.html>


More information about the Vm-dev mailing list