Add FMT_EXTERN_TEMPLATE_API for designate DLL export extern template

When exporting DLL, do not designate `__declspec(dllexport)` any template that has any explicit class template declaration a.k.a. `extern template`. Instead, designate `__declspec(dllexport)` at single point where we have explicit class template definition a.k.a. normal instantiation without `extern`

Note: this is a c++11 feature.
This commit is contained in:
denchat 2019-05-02 13:32:00 +07:00 committed by GitHub
parent e4bd8c1ef2
commit 4f919b83c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,11 +189,15 @@
# define FMT_API __declspec(dllexport)
# elif defined(FMT_SHARED)
# define FMT_API __declspec(dllimport)
# define FMT_EXTERN_TEMPLATE_API FMT_API
# endif
#endif
#ifndef FMT_API
# define FMT_API
#endif
#ifndef FMT_EXTERN_TEMPLATE_API
# define FMT_EXTERN_TEMPLATE_API
#endif
#ifndef FMT_ASSERT
# define FMT_ASSERT(condition, message) assert((condition) && message)