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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Eliot Miranda-3
 
  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: ca7e8db32835f5d2489ebddc7e14a51c9bbd4697
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ca7e8db32835f5d2489ebddc7e14a51c9bbd4697
  Author: Eliot Miranda <[hidden email]>
  Date:   2017-05-16 (Tue, 16 May 2017)

  Changed paths:
    M platforms/Cross/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.h
    M platforms/Cross/plugins/B3DAcceleratorPlugin/sqOpenGLRenderer.c
    M platforms/Cross/plugins/B3DAcceleratorPlugin/sqOpenGLRenderer.h
    M platforms/Cross/plugins/BochsIA32Plugin/sqBochsIA32Plugin.cpp
    M platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp
    M platforms/Cross/plugins/IA32ABI/ia32abi.h
    M platforms/Cross/plugins/IA32ABI/ia32abicc.c
    M platforms/Cross/plugins/IA32ABI/x64win64stub.c
    M platforms/Cross/plugins/IA32ABI/xabicc.c
    M platforms/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c
    M platforms/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.h
    M platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c
    M platforms/Cross/vm/sqVirtualMachine.c
    M platforms/win32/plugins/CameraPlugin/CameraPlugin.cpp
    M platforms/win32/vm/sqConfig.h
    M platforms/win32/vm/sqPlatformSpecific.h
    M platforms/win32/vm/sqWin32.h
    M platforms/win32/vm/sqWin32Window.c
    R spursistastacksrc/examplePlugins.ext
    R spursistastacksrc/examplePlugins.int
    R spursistastacksrc/vm/exampleSqNamedPrims.h
    R spursistastacksrc/vm/gcc3x-interp.c
    R spursistastacksrc/vm/interp.c
    R spursistastacksrc/vm/interp.h
    R spursistastacksrc/vm/vmCallback.h

  Log Message:
  -----------
  Change platform sources to refer to _WIN32 & _WIN64, not WIN32 & WIN64.
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.

Nuke spursistastacksrc; it's a misnomer.  Sista presupposes a Cogit.


Reply | Threaded
Open this post in threaded view
|

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

K K Subbu
 
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 :-(.

Regards .. Subbu
Reply | Threaded
Open this post in threaded view
|

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

Eliot Miranda-2
 
Hi Subbu,

On Tue, May 16, 2017 at 10:01 PM, K K Subbu <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

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

K K Subbu
 
On Thursday 18 May 2017 05:23 AM, Eliot Miranda wrote:
> 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'

Thanks for the clarification. You're right.

> BTW, I think the code would read much better as
>
> HandMorph>>compositionWindowManager
> CompositionWindowManager ifNotNil: [^CompositionWindowManager].
> Smalltalk windowSystemName = 'Windows'

I agree. Window API should be differentiated from the platform API in
general.

Regards .. Subbu