[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] aafcb7: Changes to sq.h and sqAssert.h to accompany commit

Eliot Miranda noreply at github.com
Tue Feb 9 05:02:10 UTC 2021


  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: aafcb78371c7e576073a8dbf2f1f32667568e05e
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e
  Author: Eliot Miranda <eliot.miranda at gmail.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M platforms/Cross/vm/sq.h
    M platforms/Cross/vm/sqAssert.h
    M platforms/win32/vm/sqWin32Heartbeat.c

  Log Message:
  -----------
  Changes to sq.h and sqAssert.h to accompany commit
dbe76be273c374a63a25e1079486a6ef2aabcfba
Author: Eliot Miranda <eliot.miranda at gmail.com>
Date:   Mon Feb 8 20:32:56 2021 -0800

    CogVM source as per  VMMaker.oscog-eem.2943

    Resolve the conflict between sqAssert.h's attempt to export warning and error to
    external plugins with the crude redefinition of the EXPORT macro on generating
    plugins. So so by moving the redefinition of EXPORT after a plugin's include
    files. The issue here is Windows' requirement to use declspec(dll_import) &
    declspec(dll_import) for sharing between exe and dll.

To allow the VM to export warning and error to external plugins, warning and
error must be correctly declared using the EXPORT macro.  Hence these macros
cannot be redefined until after the interpreters and any definitions in
sqPlatformSpecific.h have been seen and applied.

Further, so that sqPlatformSpecific.h *can* define EXPORT et al sq.h must
include it before it attempts to provide default definitions of EXPORT et al
and sq.h should never replace EXPORT et al if they have been defined.

Further still, sqPlatformSpecific.h *cannot* be included before stdio if it
is to "conveniently" define fseeko & ftello to the various 64-bit versions
certain platforms require.

Thankyou for understanding.  The idea of sqCOnfig.h is perhaps in conflict
with these changes.  However, in my opinion it is much more important that
we be able to build a complete VM on all platforms, including the ability to
use asserts in external plugins, than it is for a convenient sqConfig.h to be
usable.  As previously discussed, C includes are white box and cannot reliably
be prefixed with sqConfig.h unless we maintain each platform's sqConfig.h to
apply to every possible version of a platform's include files, an obvious
impossibility.

I ask anyone wishing to alter the system here to please contact me and discuss
before making changes.  It is extraordinarily expensive and frustrating to have
to make changes of this kind to make sure that a signfiicantly more complex VM
such as Terf's builds correctly.




More information about the Vm-dev mailing list