From ff4ab25735e4ef71d78237b41268cf352e490386 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Fri, 29 Nov 2019 10:33:47 -0500 Subject: [PATCH] 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. --- include/fmt/core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 80869b82..21f5154b 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -168,9 +168,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