Squelch MSVC warning exporting subclasses of runtime_error

When compiling {fmt} as a DLL, MSVC complains that we are exporting
classes that inherit from "std::runtime_error", which we are not
exporting.

In this case, it's not really a problem because that symbol is already
exported via the C++ stdlib. So we just add a pragma to silence the
warning.
This commit is contained in:
Chris Martin 2019-11-29 10:33:47 -05:00 committed by Victor Zverovich
parent 3c05fa46c6
commit 3bc28fcc6b

View File

@ -167,9 +167,9 @@
#if !defined(FMT_HEADER_ONLY) && defined(_WIN32) #if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
# ifdef FMT_EXPORT # ifdef FMT_EXPORT
# define FMT_API __declspec(dllexport) # define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllexport)
# elif defined(FMT_SHARED) # elif defined(FMT_SHARED)
# define FMT_API __declspec(dllimport) # define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllimport)
# define FMT_EXTERN_TEMPLATE_API FMT_API # define FMT_EXTERN_TEMPLATE_API FMT_API
# endif # endif
#endif #endif