Skip to content

Commit

Permalink
Don't make ClassInfos constexpr
Browse files Browse the repository at this point in the history
It's not defined in the declaration.
  • Loading branch information
robUx4 committed Dec 30, 2023
1 parent 362633c commit d2a17a3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,57 +57,57 @@ class EbmlElement;
#define DEFINE_xxx_MASTER(x,id,idl,parent,infinite,name,global) \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \
constexpr const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x); \
x::x() :EbmlMaster(x::ClassInfos, Context_##x) {}

// define a master class with a custom constructor
#define DEFINE_xxx_MASTER_CONS(x,id,idl,parent,infinite,name,global) \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \
constexpr const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x);
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x);

// define a master class with no parent class
#define DEFINE_xxx_MASTER_ORPHAN(x,id,idl,infinite,name,global) \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, nullptr, global, &EBML_INFO(x)); \
constexpr const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x); \

#define DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x));

#define DEFINE_xxx_CLASS(x,id,idl,parent,name,global) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, name, Context_##x);
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, name, Context_##x);

#define DEFINE_xxx_UINTEGER(x,id,idl,parent,name,global) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<std::uint64_t> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
const EbmlCallbacksDefault<std::uint64_t> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlUInteger(x::ClassInfos) {}

#define DEFINE_xxx_SINTEGER(x,id,idl,parent,name,global) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<std::int64_t> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
const EbmlCallbacksDefault<std::int64_t> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlSInteger(x::ClassInfos) {}

#define DEFINE_xxx_STRING(x,id,idl,parent,name,global) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<const char *> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
const EbmlCallbacksDefault<const char *> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlString(x::ClassInfos) {}

#define DEFINE_xxx_UNISTRING(x,id,idl,parent,name,global) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<const wchar_t *> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
const EbmlCallbacksDefault<const wchar_t *> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlUnicodeString(x::ClassInfos) {}

#define DEFINE_xxx_FLOAT(x,id,idl,parent,name,global) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<double> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
const EbmlCallbacksDefault<double> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlFloat(x::ClassInfos) {}

#define DEFINE_xxx_DATE(x,id,idl,parent,name,global) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<std::int64_t> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
const EbmlCallbacksDefault<std::int64_t> x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
x::x() :EbmlDate(x::ClassInfos) {}

#define DEFINE_xxx_BINARY(x,id,idl,parent,name,global) \
Expand All @@ -116,33 +116,33 @@ class EbmlElement;

#define DEFINE_xxx_UINTEGER_DEF(x,id,idl,parent,name,global,defval) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<std::uint64_t> x::ClassInfos(x::Create, Id_##x, static_cast<std::uint64_t>(defval), name, Context_##x); \
const EbmlCallbacksDefault<std::uint64_t> x::ClassInfos(x::Create, Id_##x, static_cast<std::uint64_t>(defval), name, Context_##x); \
x::x() :EbmlUInteger(x::ClassInfos) {}

#define DEFINE_xxx_SINTEGER_DEF(x,id,idl,parent,name,global,defval) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<std::int64_t> x::ClassInfos(x::Create, Id_##x, static_cast<std::int64_t>(defval), name, Context_##x); \
const EbmlCallbacksDefault<std::int64_t> x::ClassInfos(x::Create, Id_##x, static_cast<std::int64_t>(defval), name, Context_##x); \
x::x() :EbmlSInteger(x::ClassInfos) {}

#define DEFINE_xxx_STRING_DEF(x,id,idl,parent,name,global,defval) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<const char *> x::ClassInfos(x::Create, Id_##x, static_cast<const char *>(defval), name, Context_##x); \
const EbmlCallbacksDefault<const char *> x::ClassInfos(x::Create, Id_##x, static_cast<const char *>(defval), name, Context_##x); \
x::x() :EbmlString(x::ClassInfos) {}

#define DEFINE_xxx_UNISTRING_DEF(x,id,idl,parent,name,global,defval) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<const wchar_t *> x::ClassInfos(x::Create, Id_##x, static_cast<const wchar_t *>(defval), name, Context_##x); \
const EbmlCallbacksDefault<const wchar_t *> x::ClassInfos(x::Create, Id_##x, static_cast<const wchar_t *>(defval), name, Context_##x); \
x::x() :EbmlUnicodeString(x::ClassInfos) {}

#define DEFINE_xxx_FLOAT_DEF(x,id,idl,parent,name,global,defval) \
DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr const EbmlCallbacksDefault<double> x::ClassInfos(x::Create, Id_##x, static_cast<double>(defval), name, Context_##x); \
const EbmlCallbacksDefault<double> x::ClassInfos(x::Create, Id_##x, static_cast<double>(defval), name, Context_##x); \
x::x() :EbmlFloat(x::ClassInfos) {}

#define DEFINE_xxx_CLASS_ORPHAN(x,id,idl,name,global) \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, nullptr, global, nullptr); \
constexpr const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, name, Context_##x); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, name, Context_##x); \

#define DEFINE_EBML_CONTEXT(x) DEFINE_xxx_CONTEXT(x,GetEbmlGlobal_Context)
#define DEFINE_EBML_MASTER(x,id,idl,parent,infinite,name) DEFINE_xxx_MASTER(x,id,idl,parent,infinite,name,GetEbmlGlobal_Context)
Expand Down

0 comments on commit d2a17a3

Please sign in to comment.