D61118 : make dllexport on extern template, not the instantiation definition in format.cc
[MinGW] Fix dllexport of explicit template instantiation
https://reviews.llvm.org/D61118
Clang keeps complain it ignores __declspec(dllexport) in format.cc's instantiation of "detail::basic_data<void>;"
```
C:/Users/User/AppData/Roaming/fmt-master/src/format.cc:58:17: warning: 'dllexport' attribute ignored on explicit instantiation definition [-Wignored-attributes]
template struct FMT_INSTANTIATION_DEF_API detail::basic_data<void>;
^
C:/Users/User/AppData/Roaming/fmt-master/include\fmt/core.h:228:37: note: expanded from macro 'FMT_INSTANTIATION_DEF_API'
# define FMT_INSTANTIATION_DEF_API FMT_API
^
C:/Users/User/AppData/Roaming/fmt-master/include\fmt/core.h:210:32: note: expanded from macro 'FMT_API'
# define FMT_API __declspec(dllexport)
^
1 warning generated.
```
I guess we have to make an explicit instantiation definition of `basic_data<void>` in format.cc (without `__declspec(dllexport)` )
and make an explicit instantiation declaration (aka `extern template`) in format.h instead
user-defined constructor added to prevent Intel compilers
warnings. According to the standard, objects need to have a
user-defined constructor if instances are delcared const.
- Fix C++17 Visual Studio builds.
- Use C++17 for `windows-2019` builds.
- Removed options for unsupported compiler (MSVC11).
- Removed options, not needed after enabling C++11+ features in gmock/gtest.
Adding default case for switch statements where the compilation
flag -Wswitch-default is present on the command line when spdlog
is included in external projects.
Signed-off-by: Ryan Sherlock <ryan.m.sherlock@gmail.com>
Since the changes of 1305cbeb (Fix MSVC2019 error C2049 when compiling
with /clr (#1897), 2020-09-23), compiling fmt with MSVS 2019 resulted in
fmt\include\fmt\core.h(180,32): warning C4668: '_MANAGED' is not defined
as a preprocessor macro, replacing with '0' for '#if/#elif'.
when the (disabled by default) warning C4668 was enabled.
Fix this simply by checking if _MANAGED is defined before testing it.