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.