summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-05-08 22:59:30 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2018-05-08 22:59:35 +0100
commit8406f6d87710e8a10e217499cffd9f5669c7acc8 (patch)
treeaba8863434550ebe97879dc1ea5030246aec63d3
parentFix uniqueness of generated name for format string var (diff)
downloadlibadhocutil-8406f6d87710e8a10e217499cffd9f5669c7acc8.tar.bz2
libadhocutil-8406f6d87710e8a10e217499cffd9f5669c7acc8.tar.xz
libadhocutil-8406f6d87710e8a10e217499cffd9f5669c7acc8.zip
Inline the formatter consts
Allows a formatter to be a typedef in multiple compilation units.
-rw-r--r--libadhocutil/compileTimeFormatter.h4
1 files 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 <bool, char...> 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<id> name
#define AdHocFormatter(name, str) \
AdHocFormatterTypedef(name, str, MAKE_UNIQUE(name))