diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-03-22 04:28:00 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-03-28 08:58:40 +0100 |
commit | e3e8caf61bbc22c3b278ce8bd36501b73806d524 (patch) | |
tree | ac24885c76082486e1fbd12ef5f525ea5d566d24 /options | |
parent | 01b80e4f56cc9f5120a9a34690e6f593006e5585 (diff) |
actually expand __COUNTER__
Diffstat (limited to 'options')
-rw-r--r-- | options/metatype.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/options/metatype.cpp b/options/metatype.cpp index 64df3b1a..7962b81b 100644 --- a/options/metatype.cpp +++ b/options/metatype.cpp @@ -12,15 +12,16 @@ void declare_metatype_for_type(const char* str) } // ns options::detail -#define OPENTRACK_DEFINE_METATYPE2(t, ctr) \ - namespace { /* NOLINT(cert-dcl59-cpp) */ \ - [[maybe_unused]] \ - static const char ctr = /* NOLINT(misc-definitions-in-headers) */ \ - (::options::detail::declare_metatype_for_type<t>(#t), 0); \ - } // anon ns +#define OPENTRACK_DEFINE_METATYPE3(t, ctr) \ + static \ + const char init_##ctr = /* NOLINT(misc-definitions-in-headers) */ \ + (::options::detail::declare_metatype_for_type<t>(#t), 0); \ + +#define OPENTRACK_DEFINE_METATYPE2(t, ctr) \ + OPENTRACK_DEFINE_METATYPE3(t, ctr) #define OPENTRACK_DEFINE_METATYPE(t) \ - OPENTRACK_DEFINE_METATYPE2(t, PP_CAT(kipple_, __COUNTER__)) + OPENTRACK_DEFINE_METATYPE2(t, __COUNTER__) #define OPENTRACK_METATYPE_(x) OPENTRACK_DEFINE_METATYPE(x) #include "metatype.hpp" |