[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Changes to sq.h and sqAssert.h to accompany commit (aafcb78)
Nicolas Cellier
notifications at github.com
Wed Apr 21 21:03:26 UTC 2021
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 or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e#commitcomment-49821048
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20210421/380272c1/attachment.html>
More information about the Vm-dev
mailing list