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.
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.
* Don't include <cassert>. (#2148)
This commit replaces use of the assert() macro in format-inl.h with
FMT_ASSERT(). This allows us to drop the cassert include.
* FMT_GCC_VERSION is not defined when we include test-assert.h, use __GCC__ instead.
* Don't explicitly suppress GCC's -Wterminate in tests' FMT_ASSERT.
Throwing from a separate function is enough to silence the warning, no need to
explicitly suppress it.
* Remove messages from assertions added in 2f699d2.
* Correct formatting around throw_assertion_failure().
* fix fallback to the runtime API, add FMT_ENABLE_FALLBACK_TO_RUNTIME_API define, add test
* remove `FMT_ENABLE_FALLBACK_TO_RUNTIME_API`
* pass format string to format_to() inside format_to_n() in compile-time API
instead of compiling it inside format_to_n(), to eliminate code duplication
fixes https://github.com/fmtlib/fmt/issues/2140
- some GCC versions decay function pointers to `const void*`, exactly like
MSVC does
- legacy Clang (prior to 7.0) treats function pointers also as `const T*`
pointers, but unable to convert them