Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macros and reuse macros #267

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,23 +244,25 @@ class DllApi x : public BaseClass { \
#define EBML_INFO(ref) ref::ClassInfo()
#define EBML_ID(ref) ref::ClassId()
#define EBML_CLASS_SEMCONTEXT(ref) Context_##ref
#define EBML_CLASS_CONTEXT(ref) ref::ClassInfo().GetContext()
#define EBML_CLASS_CONTEXT(ref) EBML_INFO_CONTEXT(EBML_INFO(ref))
#define EBML_CONTEXT(e) (e)->Context()
#define EBML_NAME(e) (e)->DebugName()

#define EBML_INFO_ID(cb) (cb).ClassId()
#define EBML_INFO_NAME(cb) (cb).GetName()
#define EBML_INFO_CREATE(cb) (cb).NewElement()
#define EBML_INFO_CONTEXT(cb) (cb).GetContext()

#define EBML_SEM_CONTEXT(s) ((const libebml::EbmlCallbacks &)(s)).GetContext()
#define EBML_SEM_SPECS(s) (s).GetCallbacks()
#define EBML_SEM_CONTEXT(s) EBML_INFO_CONTEXT(EBML_SEM_SPECS(s))
#define EBML_SEM_CREATE(s) (s).Create()

#define EBML_CTX_SIZE(c) (c).GetSize()
#define EBML_CTX_MASTER(c) (c).GetMaster()
#define EBML_CTX_PARENT(c) (c).Parent()
#define EBML_CTX_IDX(c,i) (c).GetSemantic(i)
#define EBML_CTX_IDX_INFO(c,i) (const libebml::EbmlCallbacks &)((c).GetSemantic(i))
#define EBML_CTX_IDX_ID(c,i) ((const libebml::EbmlCallbacks &)((c).GetSemantic(i))).ClassId()
#define EBML_CTX_IDX_INFO(c,i) EBML_SEM_SPECS(EBML_CTX_IDX(c,i))
#define EBML_CTX_IDX_ID(c,i) EBML_INFO_ID(EBML_CTX_IDX_INFO(c,i))

#if !defined(INVALID_FILEPOS_T)
#define INVALID_FILEPOS_T 0
Expand Down