The libspectrum shared library is exporting symbols that are not part of the public API, for example those defined in internal.h (you can see that with nm --defined-only -D libspectrum.so).
This is unnecessary and creates confusion when comparing the changes between two versions of the library.
Luckily all public symbols are already tagged with WIN32_DLL, so we can take advantage of that and hide all symbols except the ones that are meant to be public.
So this patch does three things:
WIN32_DLL to LIBSPECTRUM_API (this is what makes the patch so big).LIBSPECTRUM_API to mean __attribute__ ((visibility ("default")))-fvisibility=hidden so all other symbols are hidden.Note: libspectrum_szx_write() is marked as public although it's not part of the API. The reason is because it's used directly by one of the tests.
Thanks, committed in [da6be4].
Related
Commit: [da6be4]
Test program doesn't run on Windows because libspectrum_szx_write() is not exported in the dynamic DLL library, despite being declared in internals.h
I think we could rewrite the test to use the public libspectrum_snap_write() and fix this oddity. Patch attached.
I haven't had the time to review your patch yet, but yes, ideally the tests should only use the public API and we should not export internal symbols.
Anyway #433 is now closed, maybe you could open a new one so this patch does not fall through the cracks?
I agree that updating the test so that we can make libspectrum_szx_write() internal is the best way forward.
Hi Sergio, do you want to commit the patch? It looks good to me
Thanks. Committed in [dbddb1].
Related
Commit: [dbddb1]