mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 21:16:56 +00:00
Fix compilation with MinGW
Commit 3bc28fcc6b
("Squelch MSVC warning exporting subclasses of
runtime_error", 2019-11-29) silenced a MSVC warning under. The MinGW
compiler also defines _WIN32, but does not support the "warning" pragma.
Introduce a helper macro to squelch the MSVC warning only when using the
Microsoft compiler.
Signed-off-by: Beat Bolli <dev@drbeat.li>
This commit is contained in:
parent
8bbe76af3a
commit
5981588565
@ -166,10 +166,15 @@
|
||||
#endif
|
||||
|
||||
#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
|
||||
# if FMT_MSC_VER
|
||||
# define FMT_NO_W4275 __pragma(warning(suppress : 4275))
|
||||
# else
|
||||
# define FMT_NO_W4275
|
||||
# endif
|
||||
# ifdef FMT_EXPORT
|
||||
# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllexport)
|
||||
# define FMT_API FMT_NO_W4275 __declspec(dllexport)
|
||||
# elif defined(FMT_SHARED)
|
||||
# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllimport)
|
||||
# define FMT_API FMT_NO_W4275 __declspec(dllimport)
|
||||
# define FMT_EXTERN_TEMPLATE_API FMT_API
|
||||
# endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user