The attached patch adds new macro MODPLUGEXPORT which expands to declspec(dllexport) when building libmodplug as a dll and to declspec(dllimport) when using the libmodplug dll. Developers should be advised to add MODPLUG_STATIC among their defines if they are linking against a static build of libmodplug, so that dllimport won't be assumed.
The mechanism can be expanded to use visibility attributes of gcc4+, possibly by adding a MODPLUG_PRIVATE macro, but I didn't do that. (Patch tracker item #3 suggests one approach to do that.)
Log in to post a comment.