From 8406f6d87710e8a10e217499cffd9f5669c7acc8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 8 May 2018 22:59:30 +0100 Subject: Inline the formatter consts Allows a formatter to be a typedef in multiple compilation units. --- libadhocutil/compileTimeFormatter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h index f4fdf77..c6f8de6 100644 --- a/libadhocutil/compileTimeFormatter.h +++ b/libadhocutil/compileTimeFormatter.h @@ -5,7 +5,7 @@ namespace AdHoc { /// @cond - constexpr int WRAP_AT = 120; + inline constexpr int WRAP_AT = 120; namespace FormatterImpl { template struct ParserBuffer { }; @@ -224,7 +224,7 @@ namespace AdHoc { } #define AdHocFormatterTypedef(name, str, id) \ - extern constexpr auto id = str; \ + inline extern constexpr auto id = str; \ typedef ::AdHoc::Formatter name #define AdHocFormatter(name, str) \ AdHocFormatterTypedef(name, str, MAKE_UNIQUE(name)) -- cgit v1.2.3