Closed henrikt-ma closed 10 months ago
With the patch we have
#if defined(MDDSHAREDLIBRARY)
# if defined(_MSC_VER)
# define DllImport __declspec( dllimport )
# define DllExport __declspec( dllexport )
# else
# define DllImport
# define DllExport static
# endif /* _MSC_VER */
#else
# define DllImport
# define DllExport static
#endif /* MDDSHAREDLIBRARY */
which means on Linux DllExport
will always be replaced by static
. Why not directly write static
before the corresponding functions in MDDJoystic.h and MDDRealtimeSynchronize.h?
Why not directly write
static
before the corresponding functions in MDDJoystic.h and MDDRealtimeSynchronize.h?
Yes, that would make sense. I'll just need some time to test the new variant locally before pushing to this PR.
Why not directly write
static
before the corresponding functions in MDDJoystic.h and MDDRealtimeSynchronize.h?Yes, that would make sense. I'll just need some time to test the new variant locally before pushing to this PR.
Done.
This fixes problems on Linux when spreading out the generated code for external functions over multiple translation units.
In general, I think the more clean way of fixing the problem would be to have each external C function definition be included (by means of
Include
annotation) by at most one Modelica external function, but the "trick" used here of making the definitionsstatic
is less invasive.