Fix MSVC warning needs to have dll-interface (#1185)

Unfortunately, MSVC exports everything (not only public members) when
__declspec(dllexport) is set at the class level via TAGLIB_EXPORT, which
leads to many "needs to have dll-interface to be used by clients" 4251
warnings issued by MSVC, because the std::unique_ptr pimpls are
exported too. As it is not possible to "unexport" private members,
such a warning has to be explicitly suppressed for these cases or
all public and protected class member now have to be exported
for classes derived from a template (StringList, ByteVectorList,
PropertyMap).
This commit is contained in:
Urs Fleisch
2023-12-11 06:35:08 +01:00
parent ec734bbe08
commit c9486731d9
104 changed files with 170 additions and 10 deletions
+3
View File
@@ -116,6 +116,7 @@ namespace TagLib {
audioPropertiesStyle = AudioProperties::Average) const = 0;
private:
class FileTypeResolverPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FileTypeResolverPrivate> d;
};
@@ -137,6 +138,7 @@ namespace TagLib {
audioPropertiesStyle = AudioProperties::Average) const = 0;
private:
class StreamTypeResolverPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<StreamTypeResolverPrivate> d;
};
@@ -379,6 +381,7 @@ namespace TagLib {
void parse(IOStream *stream, bool readAudioProperties, AudioProperties::ReadStyle audioPropertiesStyle);
class FileRefPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<FileRefPrivate> d;
};