Re: [OpenSmalltalk/opensmalltalk-vm] Changes to sq.h and sqAssert.h to accompany commit (aafcb78)

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

Re: [OpenSmalltalk/opensmalltalk-vm] Changes to sq.h and sqAssert.h to accompany commit (aafcb78)

David T Lewis
 

I'm amazed to not find the IMPORT/EXPORT directives in sqVirtualMachine.h

IMO, the right solution is already sketched in minheadless:

$ grep -r VM_FUNCTION_EXPORT platforms/
platforms/minheadless/windows/sqPlatformSpecific-Win32.h:#    undef VM_FUNCTION_EXPORT
platforms/minheadless/windows/sqPlatformSpecific-Win32.h:#    define VM_FUNCTION_EXPORT(returnType) __declspec( dllexport ) returnType
platforms/minheadless/windows/sqPlatformSpecific-Win32.h:#    undef VM_FUNCTION_EXPORT
platforms/minheadless/windows/sqPlatformSpecific-Win32.h:#    define VM_FUNCTION_EXPORT(returnType) __declspec( dllimport ) returnType

The relevant section is:

#  if defined(BUILD_VM_CORE) && !defined(VM_CORE_STATIC)
#    undef VM_FUNCTION_EXPORT
#    define VM_FUNCTION_EXPORT(returnType) __declspec( dllexport ) returnType
#  else
#    undef VM_FUNCTION_EXPORT
#    define VM_FUNCTION_EXPORT(returnType) __declspec( dllimport ) returnType
#  endif
#

then we would just have to declare VM_FUNCTION_EXPORT(some_return_type) some_foo_func( some_arg_type ); in sqVirtualMachine.h.
then at compile time, we just use -DBUILD_VM_CORE for compiling the VM, but omit it for compiling external plugins.
Or maybe we can just use #if !defined(SQUEAK_BUILTIN_PLUGIN) in the platform specific file, instead of if defined(BUILD_VM_CORE) && !defined(VM_CORE_STATIC)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821048", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821048", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Changes to sq.h and sqAssert.h to accompany commit (aafcb78)

David T Lewis
 

If sqConfig.h WANTS to #define fseek/ftell as fseeko and ftello, then it just has to first #include <stdio.h>.

Then any other .c including first "sqConfig.h", then <stdio.h> should just work.
This is because <stdio.h> will not be included twice (it is protected by some #ifndef)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821302", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821302", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Changes to sq.h and sqAssert.h to accompany commit (aafcb78)

David T Lewis
In reply to this post by David T Lewis
 

Problem is that stdio might include features.h


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821371", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821371", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Changes to sq.h and sqAssert.h to accompany commit (aafcb78)

David T Lewis
In reply to this post by David T Lewis
 

and sqConfig should no define fseek/ftell.
sqPlatformSpecific should…


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821392", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821392", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Changes to sq.h and sqAssert.h to accompany commit (aafcb78)

David T Lewis
In reply to this post by David T Lewis
 

Agree


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821435", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821435", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Changes to sq.h and sqAssert.h to accompany commit (aafcb78)

David T Lewis
In reply to this post by David T Lewis
 

I've tried adding EXPORT/IMPORT declarations in sqVirtualMachine.h, but it's not such a good idea

  • many function prototypes are duplicated in various win32/vm/*.c without the EXPORT, so it breaks in many places
  • most external plugins won't need the IMPORT, because they call functions through the VirtualMachine structure rather than attempt to directly link them.

I've sketched a lightweight solution in branch https://github.com/OpenSmalltalk/opensmalltalk-vm/tree/fix_include_order.
The branch can build the VM for the 3 major OSes (linux, macos, windows).
It remains to know if the solution is compatible with TERF.
Before I emit a pull request, Eliot, your comments are welcome.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49915530", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49915530", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>