Commit e5a339aa authored by Volker Krause's avatar Volker Krause
Browse files

Attempt to fix the unity build on binary factory

parent d4c89c1e
Pipeline #266715 passed with stage
in 3 minutes and 4 seconds
......@@ -11,7 +11,7 @@
namespace KItinerary {
// The property counter thing is based on the approach described here https://woboq.com/blog/verdigris-implementation-tricks.html
namespace detail {
namespace uper_detail {
template <int N = 255> struct num : public num<N - 1> {
static constexpr int value = N;
static constexpr num<N - 1> prev() { return {}; }
......@@ -22,13 +22,13 @@ template <> struct num<0> { static constexpr int value = 0; };
// start of an ASN.1 SEQUENCE definition
#define UPER_GADGET \
Q_GADGET \
static constexpr detail::num<0> _uper_optional_counter(detail::num<0>) { return {}; } \
static constexpr uper_detail::num<0> _uper_optional_counter(uper_detail::num<0>) { return {}; } \
static constexpr bool _uper_ExtensionMarker = false;
// same as UPER_GADGET, for SEQUENCES with an extension marker
#define UPER_EXTENDABLE_GADGET \
Q_GADGET \
static constexpr detail::num<0> _uper_optional_counter(detail::num<0>) { return {}; } \
static constexpr uper_detail::num<0> _uper_optional_counter(uper_detail::num<0>) { return {}; } \
static constexpr bool _uper_ExtensionMarker = true;
// ASN.1 ENUMERATED definitions, with or without extension marker
......@@ -50,8 +50,8 @@ public: \
Q_PROPERTY(Type Name MEMBER Name CONSTANT) \
Q_PROPERTY(bool Name ## IsSet READ Name ## IsSet) \
private: \
static constexpr int _uper_ ## Name ## OptionalIndex = decltype(_uper_optional_counter(detail::num<>()))::value; \
static constexpr auto _uper_optional_counter(detail::num<decltype(_uper_optional_counter(detail::num<>()))::value + 1> n) \
static constexpr int _uper_ ## Name ## OptionalIndex = decltype(_uper_optional_counter(uper_detail::num<>()))::value; \
static constexpr auto _uper_optional_counter(uper_detail::num<decltype(_uper_optional_counter(uper_detail::num<>()))::value + 1> n) \
-> decltype(n) { return {}; } \
public: \
inline bool Name ## IsSet() const { return m_optionals[m_optionals.size() - _uper_ ## Name ## OptionalIndex - 1]; }
......@@ -61,8 +61,8 @@ public: \
Type Name = DefaultValue; \
Q_PROPERTY(Type Name MEMBER Name CONSTANT) \
private: \
static constexpr int _uper_ ## Name ## OptionalIndex = decltype(_uper_optional_counter(detail::num<>()))::value; \
static constexpr auto _uper_optional_counter(detail::num<decltype(_uper_optional_counter(detail::num<>()))::value + 1> n) \
static constexpr int _uper_ ## Name ## OptionalIndex = decltype(_uper_optional_counter(uper_detail::num<>()))::value; \
static constexpr auto _uper_optional_counter(uper_detail::num<decltype(_uper_optional_counter(uper_detail::num<>()))::value + 1> n) \
-> decltype(n) { return {}; } \
inline bool Name ## IsSet() const { return m_optionals[m_optionals.size() - _uper_ ## Name ## OptionalIndex - 1]; }
}
......@@ -71,7 +71,7 @@ private: \
public: \
void decode(UPERDecoder &decoder); \
private: \
static constexpr auto _uper_OptionalCount = decltype(_uper_optional_counter(detail::num<>()))::value; \
static constexpr auto _uper_OptionalCount = decltype(_uper_optional_counter(uper_detail::num<>()))::value; \
std::bitset<_uper_OptionalCount> m_optionals; \
inline void decodeSequence(UPERDecoder &decoder) { \
if constexpr (_uper_ExtensionMarker) { \
......
......@@ -13,7 +13,7 @@
using namespace KItinerary;
void JsonLd::renameProperty(QJsonObject &obj, const char *oldName, const char *newName)
void KItinerary::JsonLd::renameProperty(QJsonObject &obj, const char *oldName, const char *newName)
{
const auto value = obj.value(QLatin1String(oldName));
if (!value.isUndefined() && !obj.contains(QLatin1String(newName))) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment