From adbc22096a6587ece7fd539122b184583f2aa5e2 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 25 Nov 2017 15:53:35 +0200 Subject: [PATCH] enable final keyword by default. Can be disabled in tweakme.h for older compilers --- include/spdlog/common.h | 6 ++++-- include/spdlog/tweakme.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 91d30dc2..ea0b0567 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -29,9 +29,11 @@ #define SPDLOG_CONSTEXPR constexpr #endif -// See tweakme.h -#if !defined(SPDLOG_FINAL) +// final keyword support. On by default. See tweakme.h +#if defined(SPDLOG_NO_FINAL) #define SPDLOG_FINAL +#else +#define SPDLOG_FINAL final #endif #if defined(__GNUC__) || defined(__clang__) diff --git a/include/spdlog/tweakme.h b/include/spdlog/tweakme.h index 191b4048..aa384065 100644 --- a/include/spdlog/tweakme.h +++ b/include/spdlog/tweakme.h @@ -126,11 +126,12 @@ /////////////////////////////////////////////////////////////////////////////// -// Uncomment to mark some types as final, allowing more optimizations in release +// Uncomment if your compiler doesn't support the "final" keyword. +// The final keyword allows more optimizations in release // mode with recent compilers. See GCC's documentation for -Wsuggest-final-types // for instance. // -// #define SPDLOG_FINAL final +// #define SPDLOG_NO_FINAL /////////////////////////////////////////////////////////////////////////////// @@ -141,6 +142,7 @@ // #define SPDLOG_ENABLE_MESSAGE_COUNTER /////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////// // Uncomment to customize level names (e.g. "MT TRACE") //