diff options
author | Chris Martin <marti4d@protonmail.com> | 2019-11-29 10:33:47 -0500 |
---|---|---|
committer | Victor Zverovich <victor.zverovich@gmail.com> | 2019-11-30 12:00:25 -0800 |
commit | 3bc28fcc6b2a9014ff4e39a4a835f8f9e90e6260 (patch) | |
tree | 631e33371a4ea71125844f9a87f8c1df64af6df2 | |
parent | 3c05fa46c66ab618e1717d62e6e3c95698bf2fd8 (diff) | |
download | fmtlib-3bc28fcc6b2a9014ff4e39a4a835f8f9e90e6260.tar.gz |
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.
-rw-r--r-- | include/fmt/core.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/fmt/core.h b/include/fmt/core.h index 14ab40f7..74e297ea 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -167,9 +167,9 @@ #if !defined(FMT_HEADER_ONLY) && defined(_WIN32) # ifdef FMT_EXPORT -# define FMT_API __declspec(dllexport) +# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllexport) # 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 # endif #endif |